liusheng
2023-06-27 0b193b98347b5563e59492d8f57eba8f67af6d23
smartor/src/main/resources/mapper/smartor/SvyLibTopicMapper.xml
@@ -29,7 +29,7 @@
        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>
@@ -45,7 +45,7 @@
        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>
@@ -87,7 +87,7 @@
         </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>
@@ -121,21 +121,5 @@
        </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>