From 3acec3660921f22b58bdaa85d61a2fcfba8e6c98 Mon Sep 17 00:00:00 2001
From: liusheng <337615773@qq.com>
Date: 星期三, 21 六月 2023 10:11:31 +0800
Subject: [PATCH] 问卷列表

---
 smartor/src/main/resources/mapper/smartor/SvyLibTitleMapper.xml |  121 +++++++++++++++++++++++-----------------
 1 files changed, 69 insertions(+), 52 deletions(-)

diff --git a/smartor/src/main/resources/mapper/smartor/SvyLibTitleMapper.xml b/smartor/src/main/resources/mapper/smartor/SvyLibTitleMapper.xml
index 3a8af1a..ca6e3e4 100644
--- a/smartor/src/main/resources/mapper/smartor/SvyLibTitleMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/SvyLibTitleMapper.xml
@@ -1,64 +1,79 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <!DOCTYPE mapper
-PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
-"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.smartor.mapper.SvyLibTitleMapper">
-    
-    <resultMap type="SvyLibTitle" id="SvyLibTitleResult">
-        <result property="svyid"    column="svyid"    />
-        <result property="categoryid"    column="categoryid"    />
-        <result property="svycode"    column="svycode"    />
-        <result property="svyname"    column="svyname"    />
-        <result property="description"    column="description"    />
-        <result property="introduce"    column="introduce"    />
-        <result property="submitprompt"    column="submitprompt"    />
-        <result property="templateid"    column="templateid"    />
-        <result property="version"    column="version"    />
-        <result property="centerlibrarycode"    column="centerlibrarycode"    />
-        <result property="centerlibraryid"    column="centerlibraryid"    />
-        <result property="islocal"    column="islocal"    />
-        <result property="isenable"    column="isenable"    />
-        <result property="orgid"    column="orgid"    />
-        <result property="delFlag"    column="del_flag"    />
-        <result property="createBy"    column="create_by"    />
-        <result property="createTime"    column="create_time"    />
-        <result property="updateBy"    column="update_by"    />
-        <result property="updateTime"    column="update_time"    />
-        <result property="isupload"    column="isupload"    />
-        <result property="uploadTime"    column="upload_time"    />
+
+    <resultMap type="com.smartor.domain.SvyLibTitle" id="SvyLibTitleResult">
+        <result property="svyid" column="svyid"/>
+        <result property="categoryid" column="categoryid"/>
+        <result property="svycode" column="svycode"/>
+        <result property="svyname" column="svyname"/>
+        <result property="description" column="description"/>
+        <result property="introduce" column="introduce"/>
+        <result property="submitprompt" column="submitprompt"/>
+        <result property="templateid" column="templateid"/>
+        <result property="version" column="version"/>
+        <result property="centerlibrarycode" column="centerlibrarycode"/>
+        <result property="centerlibraryid" column="centerlibraryid"/>
+        <result property="islocal" column="islocal"/>
+        <result property="isenable" column="isenable"/>
+        <result property="orgid" column="orgid"/>
+        <result property="delFlag" column="del_flag"/>
+        <result property="createBy" column="create_by"/>
+        <result property="createTime" column="create_time"/>
+        <result property="updateBy" column="update_by"/>
+        <result property="updateTime" column="update_time"/>
+        <result property="isupload" column="isupload"/>
+        <result property="uploadTime" column="upload_time"/>
     </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"/>
-        <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>
+    <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>
+            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>
-    
+
     <select id="selectSvyLibTitleBySvyid" parameterType="Long" resultMap="SvyLibTitleResult">
         <include refid="selectSvyLibTitleVo"/>
         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>
@@ -81,7 +96,7 @@
             <if test="updateTime != null">update_time,</if>
             <if test="isupload != null">isupload,</if>
             <if test="uploadTime != null">upload_time,</if>
-         </trim>
+        </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="categoryid != null">#{categoryid},</if>
             <if test="svycode != null">#{svycode},</if>
@@ -103,10 +118,10 @@
             <if test="updateTime != null">#{updateTime},</if>
             <if test="isupload != null">#{isupload},</if>
             <if test="uploadTime != null">#{uploadTime},</if>
-         </trim>
+        </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,11 +149,13 @@
     </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">
-        delete from svy_lib_title where svyid in 
+        delete from svy_lib_title where svyid in
         <foreach item="svyid" collection="array" open="(" separator="," close=")">
             #{svyid}
         </foreach>

--
Gitblit v1.9.3