liusheng
2023-06-21 3acec3660921f22b58bdaa85d61a2fcfba8e6c98
smartor/src/main/resources/mapper/smartor/SvyLibTitleMapper.xml
@@ -4,7 +4,7 @@
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.smartor.mapper.SvyLibTitleMapper">
    
    <resultMap type="SvyLibTitle" id="SvyLibTitleResult">
    <resultMap type="com.smartor.domain.SvyLibTitle" id="SvyLibTitleResult">
        <result property="svyid"    column="svyid"    />
        <result property="categoryid"    column="categoryid"    />
        <result property="svycode"    column="svycode"    />
@@ -29,27 +29,41 @@
    </resultMap>
    <sql id="selectSvyLibTitleVo">
        select svyid, categoryid, svycode, svyname, description, introduce, submitprompt, templateid, version, centerlibrarycode, centerlibraryid, islocal, isenable, orgid, del_flag, create_by, create_time, update_by, update_time, isupload, upload_time from svy_lib_title
        select svyid,
               categoryid,
               svycode,
               svyname,
               description,
               introduce,
               submitprompt,
               templateid,
               version,
               centerlibrarycode,
               centerlibraryid,
               islocal,
               isenable,
               orgid,
               del_flag,
               create_by,
               create_time,
               update_by,
               update_time,
               isupload,
               upload_time
        from svy_lib_title
    </sql>
    <select id="selectSvyLibTitleList" parameterType="SvyLibTitle" resultMap="SvyLibTitleResult">
        <include refid="selectSvyLibTitleVo"/>
    <select id="selectSvyLibTitleList" parameterType="com.smartor.domain.SvyLibTitleReq" resultMap="SvyLibTitleResult">
        select a.svyid, a.categoryid, a.svycode, a.svyname, a.description, a.introduce,a.submitprompt, a.templateid,
        a.version,a.centerlibrarycode, a.centerlibraryid, a.islocal, a.isenable, a.orgid, a.del_flag, a.create_by,
        a.create_time, a.update_by, a.update_time, a.isupload, a.upload_time,c.icdname from svy_lib_title
        a,icd10_association b,icd10 c
        <where>  
            <if test="categoryid != null "> and categoryid = #{categoryid}</if>
            <if test="svycode != null  and svycode != ''"> and svycode = #{svycode}</if>
            <if test="svyname != null  and svyname != ''"> and svyname like concat('%', #{svyname}, '%')</if>
            <if test="description != null  and description != ''"> and description = #{description}</if>
            <if test="introduce != null  and introduce != ''"> and introduce = #{introduce}</if>
            <if test="submitprompt != null  and submitprompt != ''"> and submitprompt = #{submitprompt}</if>
            <if test="templateid != null "> and templateid = #{templateid}</if>
            <if test="version != null "> and version = #{version}</if>
            <if test="centerlibrarycode != null  and centerlibrarycode != ''"> and centerlibrarycode = #{centerlibrarycode}</if>
            <if test="centerlibraryid != null "> and centerlibraryid = #{centerlibraryid}</if>
            <if test="islocal != null "> and islocal = #{islocal}</if>
            <if test="isenable != null "> and isenable = #{isenable}</if>
            <if test="orgid != null  and orgid != ''"> and orgid = #{orgid}</if>
            <if test="isupload != null "> and isupload = #{isupload}</if>
            <if test="uploadTime != null "> and upload_time = #{uploadTime}</if>
            a.svyid=b.SVYID and b.ICD10CODE=c.icdcode
            <if test="categoryid != null ">and a.categoryid = #{categoryid}</if>
            <if test="svyname != null  and svyname != ''">and a.svyname like concat('%', #{svyname}, '%')</if>
            <if test="description != null  and description != ''">and a.icdname like concat('%', #{description}, '%')
            </if>
        </where>
    </select>
    
@@ -58,7 +72,8 @@
        where svyid = #{svyid}
    </select>
        
    <insert id="insertSvyLibTitle" parameterType="SvyLibTitle" useGeneratedKeys="true" keyProperty="svyid">
    <insert id="insertSvyLibTitle" parameterType="com.smartor.domain.SvyLibTitle" useGeneratedKeys="true"
            keyProperty="svyid">
        insert into svy_lib_title
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="categoryid != null">categoryid,</if>
@@ -106,7 +121,7 @@
         </trim>
    </insert>
    <update id="updateSvyLibTitle" parameterType="SvyLibTitle">
    <update id="updateSvyLibTitle" parameterType="com.smartor.domain.SvyLibTitle">
        update svy_lib_title
        <trim prefix="SET" suffixOverrides=",">
            <if test="categoryid != null">categoryid = #{categoryid},</if>
@@ -134,7 +149,9 @@
    </update>
    <delete id="deleteSvyLibTitleBySvyid" parameterType="Long">
        delete from svy_lib_title where svyid = #{svyid}
        delete
        from svy_lib_title
        where svyid = #{svyid}
    </delete>
    <delete id="deleteSvyLibTitleBySvyids" parameterType="String">