liusheng
11 小时以前 e180e3a496d6f29d3a3b34016400de9d997c6bd9
smartor/src/main/resources/mapper/smartor/SvyLibTemplateScriptMapper.xml
@@ -46,11 +46,19 @@
        <result property="targetoptions" column="targetoptions"/>
        <result property="prompt" column="prompt"/>
        <result property="groupName" column="group_name"/>
        <result property="dutyDeptName" column="duty_dept_name"/>
        <result property="dutyDeptCode" column="duty_dept_code"/>
        <result property="reportDeptCode" column="report_dept_name"/>
        <result property="reportDeptName" column="report_dept_code"/>
    </resultMap>
    <sql id="selectSvyLibTemplateScriptVo">
        select id,
               script_type,
               duty_dept_name,
               duty_dept_code,
               report_dept_name,
               report_dept_code,
               targetid,
               group_name,
               targetname,
@@ -81,6 +89,7 @@
               pid,
               guid,
               categoryid,
               categoryName,
               script_content,
               suitway,
               script_picture,
@@ -110,6 +119,7 @@
            <if test="guid != null  and guid != ''">and guid = #{guid}</if>
            <if test="prompt != null  and prompt != ''">and prompt = #{prompt}</if>
            <if test="categoryid != null ">and categoryid = #{categoryid}</if>
        <if test="categoryName != null ">and categoryName = #{categoryName}</if>
            <if test="scriptContent != null  and scriptContent != ''">and script_content = #{scriptContent}</if>
            <if test="suitway != null  and suitway != ''">and suitway = #{suitway}</if>
            <if test="isavailable != null  and isavailable != ''">and isavailable = #{isavailable}</if>
@@ -130,6 +140,28 @@
            <if test="targetoptions != null  and targetoptions != ''">and targetoptions = #{targetoptions}</if>
            <if test="score != null">and score = #{score}</if>
            <if test="groupName != null">and group_name = #{groupName}</if>
        <if test="dutyDeptName != null  and dutyDeptName != ''">and duty_dept_name like concat('%', #{dutyDeptName},
            '%')
        </if>
        <if test="dutyDeptCode != null  and dutyDeptCode != ''">and duty_dept_code like concat('%', #{dutyDeptCode},
            '%')
        </if>
        <if test="reportDeptName != null  and reportDeptName != ''">and report_dept_name like concat('%',
            #{reportDeptName},
            '%')
        </if>
        <if test="reportDeptCode != null  and reportDeptCode != ''">and report_dept_code like concat('%',
            #{reportDeptCode},
            '%')
        </if>
        <if test="categoryids != null">
            and categoryid in
            <foreach collection="categoryids" item="categoryid" open="(" separator=","
                     close=")">
                #{categoryid}
            </foreach>
        </if>
        <if test="pageSize != null  and pageNum != null">limit ${pageSize} OFFSET ${pageNum}</if>
    </select>
    <select id="selectSvyLibTemplateScriptByTopicid" parameterType="Long" resultMap="SvyLibTemplateScriptResult">
@@ -181,6 +213,11 @@
            <if test="targetoptions != null  and targetoptions != ''">targetoptions,</if>
            <if test="prompt != null  and prompt != ''">prompt,</if>
            <if test="groupName != null  and groupName != ''">group_name,</if>
            <if test="dutyDeptName != null  and dutyDeptName != ''">duty_dept_name,</if>
            <if test="dutyDeptCode != null  and dutyDeptCode != ''">duty_dept_code,</if>
            <if test="reportDeptName != null  and reportDeptName != ''">report_dept_name,</if>
            <if test="reportDeptCode != null  and reportDeptCode != ''">report_dept_code,</if>
            <if test="categoryName != null  and categoryName != ''">categoryName,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="nextScriptno != null">#{nextScriptno},</if>
@@ -223,6 +260,11 @@
            <if test="targetoptions != null  and targetoptions != ''">#{targetoptions},</if>
            <if test="prompt != null  and prompt != ''">#{prompt},</if>
            <if test="groupName != null  and groupName != ''">#{groupName},</if>
            <if test="dutyDeptName != null  and dutyDeptName != ''">#{dutyDeptName},</if>
            <if test="dutyDeptCode != null  and dutyDeptCode != ''">#{dutyDeptCode},</if>
            <if test="reportDeptName != null  and reportDeptName != ''">#{reportDeptName},</if>
            <if test="reportDeptCode != null  and reportDeptCode != ''">#{reportDeptCode},</if>
            <if test="categoryName != null  and categoryName != ''">#{categoryName},</if>
        </trim>
    </insert>
@@ -271,6 +313,11 @@
            <if test="targetoptions != null  and targetoptions != ''">targetoptions = #{targetoptions},</if>
            <if test="prompt != null  and prompt != ''">prompt = #{prompt},</if>
            <if test="groupName != null  and groupName != ''">group_name = #{groupName},</if>
            <if test="dutyDeptName != null  and dutyDeptName != ''">duty_dept_name = #{dutyDeptName},</if>
            <if test="dutyDeptCode != null  and dutyDeptCode != ''">duty_dept_code = #{dutyDeptCode},</if>
            <if test="reportDeptName != null  and reportDeptName != ''">report_dept_name = #{reportDeptName},</if>
            <if test="reportDeptCode != null  and reportDeptCode != ''">report_dept_code = #{reportDeptCode},</if>
            <if test="categoryName != null  and categoryName != ''">categoryName = #{categoryName},</if>
        </trim>
        where id = #{id}
    </update>
@@ -287,4 +334,15 @@
            #{id}
        </foreach>
    </delete>
    <select id="querySvyLibTemplateIds"  resultMap="SvyLibTemplateScriptResult">
        <include refid="selectSvyLibTemplateScriptVo"/>
        where del_flag=0
        <if test="scriptCategoryids != null and scriptCategoryids.size > 0">
        and categoryid in
        <foreach item="scriptCategoryid" collection="scriptCategoryids" open="(" separator="," close=")">
            #{scriptCategoryid}
        </foreach>
        </if>
    </select>
</mapper>