| | |
| | | select topicid, oldid, svyid, topictype, topiccode, topic, sort, ismandatory, ishide, del_flag, orgid, create_by, create_time, update_by, update_time, isupload, upload_time,tag from svy_lib_topic |
| | | </sql> |
| | | |
| | | <select id="selectSvyLibTopicList" parameterType="SvyLibTopic" resultMap="SvyLibTopicResult"> |
| | | <select id="selectSvyLibTopicList" parameterType="com.smartor.domain.SvyLibTopic" resultMap="SvyLibTopicResult"> |
| | | <include refid="selectSvyLibTopicVo"/> |
| | | <where> |
| | | <if test="oldid != null "> and oldid = #{oldid}</if> |
| | |
| | | where topicid = #{topicid} |
| | | </select> |
| | | |
| | | <insert id="insertSvyLibTopic" parameterType="SvyLibTopic" useGeneratedKeys="true" keyProperty="topicid"> |
| | | <insert id="insertSvyLibTopic" parameterType="com.smartor.domain.SvyLibTopic" useGeneratedKeys="true" keyProperty="topicid"> |
| | | insert into svy_lib_topic |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="oldid != null">oldid,</if> |
| | |
| | | </trim> |
| | | </insert> |
| | | |
| | | <update id="updateSvyLibTopic" parameterType="SvyLibTopic"> |
| | | <update id="updateSvyLibTopic" parameterType="com.smartor.domain.SvyLibTopic"> |
| | | update svy_lib_topic |
| | | <trim prefix="SET" suffixOverrides=","> |
| | | <if test="oldid != null">oldid = #{oldid},</if> |
| | |
| | | </foreach> |
| | | </delete> |
| | | |
| | | <select id="showTopic" resultType="com.smartor.domain.SvyLibTopicAndOptionRes" |
| | | parameterType="com.smartor.domain.SvyTopicReq"> |
| | | SELECT a.topicid, a.topiccode, a.topic, a.topictype, a.tag, b.optioncode, b.optioncontent |
| | | FROM svy_lib_topic a, |
| | | svy_lib_topicoption b |
| | | WHERE a.topicid = b.topicid |
| | | <if test="topic != null and topic != ''"> |
| | | and a.topic LIKE concat('%', #{topic}, '%') |
| | | </if> |
| | | <if test="topicType != null and topicType != ''"> |
| | | and a.topictype = #{topicType} |
| | | </if> |
| | | <if test="tag != null and tag != ''"> |
| | | and a.tag LIKE concat('%', #{tag}, '%') |
| | | </if> |
| | | GROUP BY a.topic, b.optioncode |
| | | </select> |
| | | |
| | | </mapper> |