From da026a34bcc97b2eb49607a3b02d94d8f683f997 Mon Sep 17 00:00:00 2001
From: liusheng <337615773@qq.com>
Date: 星期三, 07 一月 2026 16:18:35 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 smartor/src/main/resources/mapper/smartor/SchemeTaskMapper.xml                    |    3 
 smartor/src/main/resources/mapper/smartor/HeCategoryMapper.xml                    |    3 
 smartor/src/main/resources/mapper/smartor/PatHetaskRelevanceMapper.xml            |    5 
 smartor/src/main/resources/mapper/smartor/PatMedWeightMapper.xml                  |    3 
 smartor/src/main/resources/mapper/smartor/HeLibraryAssortMapper.xml               |    5 
 smartor/src/main/resources/mapper/smartor/IvrLibaExtemplateMapper.xml             |    5 
 smartor/src/main/resources/mapper/smartor/IvrSceneIntentMapper.xml                |    3 
 smartor/src/main/resources/mapper/smartor/SvyTaskScriptMapper.xml                 |    3 
 ruoyi-generator/src/main/resources/vm/xml/mapper.xml.vm                           |    5 
 smartor/src/main/resources/mapper/smartor/IvrLibaTemplateScriptMapper.xml         |    5 
 smartor/src/main/resources/mapper/smartor/PatMedBloodsugarMapper.xml              |    3 
 smartor/src/main/resources/mapper/smartor/ServiceSubtaskPreachformMapper.xml      |   18 
 smartor/src/main/resources/mapper/smartor/SvyTaskScriptoptionMapper.xml           |    3 
 smartor/src/main/resources/mapper/smartor/IvrLibaTargetoptionMapper.xml           |    5 
 smartor/src/main/resources/mapper/smartor/ServiceSubtaskDetailMapper.xml          |    3 
 smartor/src/main/resources/mapper/smartor/IvrLibaTemplateAssortMapper.xml         |    6 
 smartor/src/main/resources/mapper/smartor/HeLocallibraryMapper.xml                |    5 
 smartor/src/main/resources/mapper/smartor/PatWildcardMapper.xml                   |    4 
 smartor/src/main/resources/mapper/smartor/IvrLibaTemplateTagMapper.xml            |    5 
 smartor/src/main/resources/mapper/smartor/SchemeLocallibraryMapper.xml            |    3 
 smartor/src/main/resources/mapper/smartor/SvyLibResultMapper.xml                  |    3 
 .idea/jarRepositories.xml                                                         |    6 
 smartor/src/main/resources/mapper/smartor/IvrLibaExtemplateCategoryMapper.xml     |    3 
 smartor/src/main/resources/mapper/smartor/IvrSceneGlobalconfigMapper.xml          |    3 
 ruoyi-system/src/main/resources/mapper/system/SysLogininforMapper.xml             |   36 
 smartor/src/main/resources/mapper/smartor/ServiceTaskoperMapper.xml               |    5 
 smartor/src/main/resources/mapper/smartor/SvyTaskTemplateMapper.xml               |    5 
 smartor/src/main/resources/mapper/smartor/IvrLibIntentMapper.xml                  |    3 
 smartor/src/main/resources/mapper/smartor/PatArchivetagMapper.xml                 |    8 
 smartor/src/main/resources/mapper/smartor/IvrSceneRecallMapper.xml                |    3 
 smartor/src/main/resources/mapper/smartor/PatMedOuthospProvisionalMapper.xml      |    5 
 smartor/src/main/resources/mapper/smartor/TemplateDeptMapper.xml                  |    5 
 smartor/src/main/resources/mapper/smartor/HospitalRecordMapper.xml                |    3 
 smartor/src/main/resources/mapper/smartor/IvrTasksmsMapper.xml                    |    3 
 smartor/src/main/resources/mapper/smartor/ServiceSubtaskAnswerMapper.xml          |    3 
 smartor/src/main/resources/mapper/smartor/PatMedInspectionItemMapper.xml          |    3 
 ruoyi-system/src/main/resources/mapper/system/SysConfigMapper.xml                 |    6 
 smartor/src/main/resources/mapper/smartor/IvrLibaScriptTargetMapper.xml           |    3 
 smartor/src/main/resources/mapper/smartor/SchemeTriggerruleMapper.xml             |    3 
 smartor/src/main/resources/mapper/smartor/PatArchiveImportMapper.xml              |    5 
 smartor/src/main/resources/mapper/smartor/BaseOrganizationMapper.xml              |    5 
 smartor/src/main/resources/mapper/smartor/IvrLibaExtemplatescriptMapper.xml       |    8 
 ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml                   |    5 
 smartor/src/main/resources/mapper/smartor/SvyLibScriptOptionMapper.xml            |    5 
 smartor/src/main/resources/mapper/smartor/SchemeTaskrepeatconfigMapper.xml        |    3 
 ruoyi-system/src/main/resources/mapper/system/SmsParamMapper.xml                  |    3 
 smartor/src/main/resources/mapper/smartor/ServiceTaskdeptMapper.xml               |   17 
 smartor/src/main/resources/mapper/smartor/IvrLibaTargetAssortMapper.xml           |    4 
 ruoyi-system/src/main/resources/mapper/system/SmsTempletMapper.xml                |    6 
 smartor/src/main/resources/mapper/smartor/IvrTaskTemplateScriptMapper.xml         |    5 
 smartor/src/main/resources/mapper/smartor/ServiceCheckMapper.xml                  |    5 
 smartor/src/main/resources/mapper/smartor/MedicalHistoryMapper.xml                |    3 
 smartor/src/main/resources/mapper/smartor/SvyLibExceptionMapper.xml               |    3 
 ruoyi-quartz/src/main/resources/mapper/quartz/SysJobMapper.xml                    |   30 
 smartor/src/main/resources/mapper/smartor/IvrSceneFlownodeMapper.xml              |    3 
 smartor/src/main/resources/mapper/smartor/IvrScenecategoryMapper.xml              |    3 
 smartor/src/main/resources/mapper/smartor/SvyTopicoptionMapper.xml                |    3 
 smartor/src/main/resources/mapper/smartor/BaseTagMapper.xml                       |    6 
 smartor/src/main/resources/mapper/smartor/ServiceThirdDataMapper.xml              |    3 
 smartor/src/main/resources/mapper/smartor/SvyLibTemplateTagMapper.xml             |    5 
 smartor/src/main/resources/mapper/smartor/PatArchivecontactMapper.xml             |    5 
 smartor/src/main/resources/mapper/smartor/HospitalUserinfoMapper.xml              |    3 
 smartor/src/main/resources/mapper/smartor/IvrSceneMapper.xml                      |    3 
 ruoyi-system/src/main/resources/mapper/system/SysNoticeMapper.xml                 |    5 
 smartor/src/main/resources/mapper/smartor/IvrLibaScriptTagMapper.xml              |    3 
 smartor/src/main/resources/mapper/smartor/IvrLibScriptmodelMapper.xml             |    3 
 ruoyi-system/src/main/resources/mapper/system/EquipmentinfoMapper.xml             |    6 
 smartor/src/main/resources/mapper/smartor/SvyLibTemplateTargetoptionWjxMapper.xml |    3 
 smartor/src/main/resources/mapper/smartor/ServiceOutPathMapper.xml                |    5 
 smartor/src/main/resources/mapper/smartor/ServiceTaskMapper.xml                   |   16 
 smartor/src/main/resources/mapper/smartor/SchemeTaskrecordCalldetailMapper.xml    |    3 
 smartor/src/main/resources/mapper/smartor/IvrTaskcallrecordMapper.xml             |    3 
 smartor/src/main/resources/mapper/smartor/IvrSceneExecuteconfigMapper.xml         |    3 
 smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml                |  140 +++--
 smartor/src/main/resources/mapper/smartor/PatMedInspectionMapper.xml              |    3 
 smartor/src/main/resources/mapper/smartor/IvrLibaTargetMapper.xml                 |   10 
 ruoyi-generator/src/main/resources/mapper/generator/GenTableMapper.xml            |   30 
 ruoyi-system/src/main/resources/mapper/system/SysDictDataMapper.xml               |    6 
 smartor/src/main/resources/mapper/smartor/IvrLibaTemplateMapper.xml               |    5 
 smartor/src/main/resources/mapper/smartor/SvyTaskAnswerMapper.xml                 |    3 
 smartor/src/main/resources/mapper/smartor/SvyTaskMapper.xml                       |    3 
 smartor/src/main/resources/mapper/smartor/PatMedInhospMapper.xml                  |  398 +++++++-------
 smartor/src/main/resources/mapper/smartor/IvrLibIntentcategoryMapper.xml          |    3 
 smartor/src/main/resources/mapper/smartor/BaseTagcategoryMapper.xml               |   16 
 smartor/src/main/resources/mapper/smartor/SvyLibTemplateScriptMapper.xml          |    5 
 smartor/src/main/resources/mapper/smartor/SvyLibTemplateScriptWjxMapper.xml       |    3 
 smartor/src/main/resources/mapper/smartor/IvrLibScriptMapper.xml                  |    3 
 smartor/src/main/resources/mapper/smartor/ServiceSubtaskRecordMapper.xml          |    3 
 smartor/src/main/resources/mapper/smartor/IvrTaskTemplateMapper.xml               |    5 
 smartor/src/main/resources/mapper/smartor/PatSpeciallistMapper.xml                |    3 
 smartor/src/main/resources/mapper/smartor/SchemeTriggersceneMapper.xml            |    3 
 smartor/src/main/resources/mapper/smartor/ServicePatientTempMapper.xml            |    3 
 smartor/src/main/resources/mapper/smartor/PatSatisfactionMapper.xml               |    5 
 smartor/src/main/resources/mapper/smartor/MinioFileMapper.xml                     |    3 
 smartor/src/main/resources/mapper/smartor/PatMedOuthospMapper.xml                 |   23 
 smartor/src/main/resources/mapper/smartor/IvrLibScriptcategoryMapper.xml          |    3 
 smartor/src/main/resources/mapper/smartor/SysUserImportMapper.xml                 |    3 
 smartor/src/main/resources/mapper/smartor/IvrSceneScriptMapper.xml                |    3 
 smartor/src/main/resources/mapper/smartor/SvyCategoryMapper.xml                   |   11 
 smartor/src/main/resources/mapper/smartor/Icd10Mapper.xml                         |    5 
 smartor/src/main/resources/mapper/smartor/HeLibraryTagMapper.xml                  |    5 
 smartor/src/main/resources/mapper/smartor/SvyLibTemplageCategoryMapper.xml        |    5 
 smartor/src/main/resources/mapper/smartor/IvrLibaTargetTagMapper.xml              |    5 
 ruoyi-quartz/src/main/resources/mapper/quartz/CollectHISMapper.xml                |   39 
 ruoyi-system/src/main/resources/mapper/system/BaseUserInfoMapper.xml              |    3 
 smartor/src/main/resources/mapper/smartor/Icd10AssociationMapper.xml              |    3 
 smartor/src/main/resources/mapper/smartor/IvrLibaTemplateTargetoptionMapper.xml   |    5 
 smartor/src/main/resources/mapper/smartor/PatArchiveMapper.xml                    |   48 -
 smartor/src/main/resources/mapper/smartor/SvyFinishtopicMapper.xml                |    3 
 smartor/src/main/resources/mapper/smartor/SvyLibTemplateWjxMapper.xml             |    3 
 smartor/src/main/resources/mapper/smartor/PatMedHypertensionMapper.xml            |    3 
 ruoyi-system/src/main/resources/mapper/system/SysMenuMapper.xml                   |    6 
 smartor/src/main/resources/mapper/smartor/IvrLibaScriptTargetoptionMapper.xml     |    5 
 smartor/src/main/resources/mapper/smartor/PatMedRegistrationMapper.xml            |    3 
 smartor/src/main/resources/mapper/smartor/SvyLibScriptTagMapper.xml               |    5 
 smartor/src/main/resources/mapper/smartor/HNGatherPatArchiveMapper.xml            |   29 
 smartor/src/main/resources/mapper/smartor/IvrSceneScriptmodelMapper.xml           |    3 
 smartor/src/main/resources/mapper/smartor/SchemePlanMapper.xml                    |    3 
 smartor/src/main/resources/mapper/smartor/IvrLibaScriptAssortMapper.xml           |    4 
 smartor/src/main/resources/mapper/smartor/PatFilterlistMapper.xml                 |    3 
 smartor/src/main/resources/mapper/smartor/BaseDictOperationMapper.xml             |    3 
 .idea/modules.xml                                                                 |    2 
 smartor/src/main/resources/mapper/smartor/IvrSceneFlownodebranchMapper.xml        |    3 
 smartor/src/main/resources/mapper/smartor/SvyLibScriptMapper.xml                  |    5 
 smartor/src/main/resources/mapper/smartor/SchemeAutofinshruleMapper.xml           |    3 
 smartor/src/main/resources/mapper/smartor/IvrTaskTemplateTargetoptionMapper.xml   |    3 
 smartor/src/main/resources/mapper/smartor/SvyLibTopicdirectionMapper.xml          |    4 
 ruoyi-system/src/main/resources/mapper/system/SmsRecordsMapper.xml                |    5 
 smartor/src/main/resources/mapper/smartor/IvrTaskVisitResultMapper.xml            |    3 
 smartor/src/main/resources/mapper/smartor/PatArchiveOutMapper.xml                 |   19 
 smartor/src/main/resources/mapper/smartor/SvyTopicMapper.xml                      |    3 
 ruoyi-system/src/main/resources/mapper/system/SysDictTypeMapper.xml               |   36 
 smartor/src/main/resources/mapper/smartor/SchemeCategoryMapper.xml                |    3 
 smartor/src/main/resources/mapper/smartor/SchemeTaskconfigMapper.xml              |    3 
 smartor/src/main/resources/mapper/smartor/SvyTaskTemplateTargetoptionMapper.xml   |    5 
 smartor/src/main/resources/mapper/smartor/PatSpeciallistCategoryMapper.xml        |    3 
 smartor/src/main/resources/mapper/smartor/SvyFinishoptionMapper.xml               |    3 
 smartor/src/main/resources/mapper/smartor/BaseSmsaccountMapper.xml                |    3 
 smartor/src/main/resources/mapper/smartor/PatMedPhysicalMapper.xml                |    3 
 smartor/src/main/resources/mapper/smartor/PatMedOperationMapper.xml               |    5 
 smartor/src/main/resources/mapper/smartor/SvyLibTemplateMapper.xml                |    5 
 smartor/src/main/resources/mapper/smartor/IvrLibaScriptMapper.xml                 |    5 
 ruoyi-quartz/src/main/resources/mapper/quartz/SysJobLogMapper.xml                 |   42 
 ruoyi-system/src/main/resources/mapper/system/SysPostMapper.xml                   |    6 
 smartor/src/main/resources/mapper/smartor/SchemeTaskrecordMapper.xml              |    3 
 smartor/src/main/resources/mapper/smartor/SvyTaskSingleMapper.xml                 |    3 
 smartor/src/main/resources/mapper/smartor/SvyFinishMapper.xml                     |    3 
 ruoyi-system/src/main/resources/mapper/system/SysOperLogMapper.xml                |   54 +-
 smartor/src/main/resources/mapper/smartor/PatMedDrugMapper.xml                    |    3 
 smartor/src/main/resources/mapper/smartor/SvyLibTemplateTargetoptionMapper.xml    |    5 
 smartor/src/main/resources/mapper/smartor/PatMedOperationItemMapper.xml           |    3 
 smartor/src/main/resources/mapper/smartor/SysUserDeptMapper.xml                   |    5 
 smartor/src/main/resources/mapper/smartor/IvrSceneFlowMapper.xml                  |    3 
 smartor/src/main/resources/mapper/smartor/ServiceTaskdiagMapper.xml               |    5 
 smartor/src/main/resources/mapper/smartor/SvyTaskTemplateScriptMapper.xml         |    3 
 smartor/src/main/resources/mapper/smartor/SvyLibTopicCategoryMapper.xml           |    5 
 smartor/src/main/resources/mapper/smartor/HeLibraryMapper.xml                     |    5 
 smartor/src/main/resources/mapper/smartor/SysUserRole2Mapper.xml                  |    3 
 158 files changed, 729 insertions(+), 828 deletions(-)

diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml
index 07de0f8..dc70b1c 100644
--- a/.idea/jarRepositories.xml
+++ b/.idea/jarRepositories.xml
@@ -9,12 +9,12 @@
     <remote-repository>
       <option name="id" value="central" />
       <option name="name" value="Central Repository" />
-      <option name="url" value="http://maven.aliyun.com/nexus/content/groups/public/" />
+      <option name="url" value="https://repo.maven.apache.org/maven2" />
     </remote-repository>
     <remote-repository>
       <option name="id" value="central" />
       <option name="name" value="Central Repository" />
-      <option name="url" value="https://repo.maven.apache.org/maven2" />
+      <option name="url" value="http://maven.aliyun.com/nexus/content/groups/public/" />
     </remote-repository>
     <remote-repository>
       <option name="id" value="releases" />
@@ -97,4 +97,4 @@
       <option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
     </remote-repository>
   </component>
-</project>
+</project>
\ No newline at end of file
diff --git a/.idea/modules.xml b/.idea/modules.xml
index 3e40b07..c10d336 100644
--- a/.idea/modules.xml
+++ b/.idea/modules.xml
@@ -5,4 +5,4 @@
       <module fileurl="file://$PROJECT_DIR$/ruoyi-admin/ruoyi-admin.iml" filepath="$PROJECT_DIR$/ruoyi-admin/ruoyi-admin.iml" />
     </modules>
   </component>
-</project>
+</project>
\ No newline at end of file
diff --git a/ruoyi-generator/src/main/resources/mapper/generator/GenTableMapper.xml b/ruoyi-generator/src/main/resources/mapper/generator/GenTableMapper.xml
index 65cfcd6..94b2e4a 100644
--- a/ruoyi-generator/src/main/resources/mapper/generator/GenTableMapper.xml
+++ b/ruoyi-generator/src/main/resources/mapper/generator/GenTableMapper.xml
@@ -59,20 +59,22 @@
 
     <select id="selectGenTableList" parameterType="GenTable" resultMap="GenTableResult">
 		<include refid="selectGenTableVo"/>
-		<where>
-			<if test="tableName != null and tableName != ''">
-				AND lower(table_name) like lower(concat('%', #{tableName}, '%'))
-			</if>
-			<if test="tableComment != null and tableComment != ''">
-				AND lower(table_comment) like lower(concat('%', #{tableComment}, '%'))
-			</if>
-			<if test="params.beginTime != null and params.beginTime != ''"><!-- 寮�濮嬫椂闂存绱� -->
-				AND date_format(create_time,'%y%m%d') &gt;= date_format(#{params.beginTime},'%y%m%d')
-			</if>
-			<if test="params.endTime != null and params.endTime != ''"><!-- 缁撴潫鏃堕棿妫�绱� -->
-				AND date_format(create_time,'%y%m%d') &lt;= date_format(#{params.endTime},'%y%m%d')
-			</if>
-		</where>
+		where 1=1
+		<if test="orgid != null and orgid != ''">
+			AND orgid = #{orgid}
+		</if>
+		<if test="tableName != null and tableName != ''">
+			AND lower(table_name) like lower(concat('%', #{tableName}, '%'))
+		</if>
+		<if test="tableComment != null and tableComment != ''">
+			AND lower(table_comment) like lower(concat('%', #{tableComment}, '%'))
+		</if>
+		<if test="params.beginTime != null and params.beginTime != ''"><!-- 寮�濮嬫椂闂存绱� -->
+			AND date_format(create_time,'%y%m%d') &gt;= date_format(#{params.beginTime},'%y%m%d')
+		</if>
+		<if test="params.endTime != null and params.endTime != ''"><!-- 缁撴潫鏃堕棿妫�绱� -->
+			AND date_format(create_time,'%y%m%d') &lt;= date_format(#{params.endTime},'%y%m%d')
+		</if>
 	</select>
 
 	<select id="selectDbTableList" parameterType="GenTable" resultMap="GenTableResult">
diff --git a/ruoyi-generator/src/main/resources/vm/xml/mapper.xml.vm b/ruoyi-generator/src/main/resources/vm/xml/mapper.xml.vm
index 540d0ac..509b19b 100644
--- a/ruoyi-generator/src/main/resources/vm/xml/mapper.xml.vm
+++ b/ruoyi-generator/src/main/resources/vm/xml/mapper.xml.vm
@@ -31,8 +31,8 @@
     <select id="select${ClassName}List" parameterType="${packageName}.domain.${ClassName}"
             resultMap="${ClassName}Result">
         <include refid="select${ClassName}Vo"/>
-        <where>
-            del_flag=0
+        where 1=1
+            and del_flag=0
             #foreach($column in $columns)
                 #set($queryType=$column.queryType)
                 #set($javaField=$column.javaField)
@@ -75,7 +75,6 @@
                     #end
                 #end
             #end
-        </where>
     </select>
 
     <select id="select${ClassName}By${pkColumn.capJavaField}" parameterType="${pkColumn.javaType}"
diff --git a/ruoyi-quartz/src/main/resources/mapper/quartz/CollectHISMapper.xml b/ruoyi-quartz/src/main/resources/mapper/quartz/CollectHISMapper.xml
index bb424fa..7975eb9 100644
--- a/ruoyi-quartz/src/main/resources/mapper/quartz/CollectHISMapper.xml
+++ b/ruoyi-quartz/src/main/resources/mapper/quartz/CollectHISMapper.xml
@@ -366,24 +366,28 @@
     <select id="yhyjsxx" parameterType="com.ruoyi.common.core.domain.entity.SysUser" resultMap="SysUserRoleResult">
         select user_id, role_id, orgid
         FROM healthy_user_role
-        <where>
+        where 1=1
+            <if test="orgid != null and orgid != ''">
+                AND orgid = #{orgid}
+            </if>
             <if test="hisUserId != null ">and user_id = #{hisUserId}</if>
-        </where>
     </select>
 
     <select id="yhyksxx" parameterType="com.ruoyi.common.core.domain.entity.SysUser" resultMap="SysUserDeptResult">
         select user_id , user_code , dept_type ,dept_code,dept_name,deptparent,del_flag,orgid
         FROM healthy_user_dept
-        <where>
-            user_id != 'admin'
-            <if test="hisUserId != null ">and user_id = #{hisUserId}</if>
-        </where>
+        where 1=1
+        and user_id != 'admin'
+        <if test="orgid != null and orgid != ''">
+            AND orgid = #{orgid}
+        </if>
+        <if test="hisUserId != null ">and user_id = #{hisUserId}</if>
     </select>
 
 
     <select id="selectPatArchiveList" parameterType="com.smartor.domain.PatArchive" resultMap="PatArchiveResult">
         <include refid="selectPatArchiveVo"/>
-        <where>
+        where 1=1
             <if test="name != null  and name != ''">and name like concat('%', #{name}, '%')</if>
             <if test="idcardno != null  and idcardno != ''">and idcardno = #{idcardno}</if>
             <if test="sourcefrom != null ">and sourcefrom = #{sourcefrom}</if>
@@ -422,7 +426,6 @@
             <if test="pageSize != null and pageSize!='' ">and rownum&lt;#{pageSize}</if>
 
 
-        </where>
     </select>
 
 
@@ -495,8 +498,7 @@
 
         FROM
         healthy_inhosp b
-        <where>
-
+        where 1=1
             <if test="startOutHospTime != null ">
                 and to_char(b.endtime, 'YYYY-MM-DD HH24:MI:SS') &gt;=to_char(#{startOutHospTime},'YYYY-MM-DD HH24:MI:SS')
             </if>
@@ -525,7 +527,6 @@
             <if test="lastEndTime != null and lastEndTime != ''">
                 and to_char(last_Update_Time, 'YYYY-MM-DD HH24:MI:SS') &lt;= #{lastEndTime}
             </if>
-        </where>
     </select>
 
 
@@ -552,8 +553,10 @@
         patname,
         mainsuit
         from healthy_outhosp
-        <where>
-
+        where 1=1
+            <if test="orgid != null and orgid != ''">
+                AND orgid = #{orgid}
+            </if>
             <if test="beginTime != null ">
                 and to_char(admitdate, 'YYYY-MM-DD HH24:MI:SS') &gt;= to_char(#{beginTime}, 'YYYY-MM-DD HH24:MI:SS')
             </if>
@@ -566,7 +569,6 @@
             <if test="lastEndTime != null and lastEndTime != ''">
                 and to_char(last_Update_Time, 'YYYY-MM-DD HH24:MI:SS') &lt;= #{lastEndTime}
             </if>
-        </where>
     </select>
 
 
@@ -579,7 +581,7 @@
         icdname,
         icdpym
         from healthy_disease
-        <where>
+        where 1=1
             <if test="icdcode != null  and icdcode != ''">and icdcode = #{icdcode}</if>
             <if test="lastflag != null  and lastflag != ''">and lastflag = #{lastflag}</if>
             <if test="chimedflag != null  and chimedflag != ''">and chimedflag = #{chimedflag}</if>
@@ -590,7 +592,6 @@
             <if test="pid != null ">and pid = #{pid}</if>
             <if test="guid != null  and guid != ''">and guid = #{guid}</if>
             <if test="hisIcdid != null  and hisIcdid != ''">and his_icdid = #{hisIcdid}</if>
-        </where>
     </select>
 
 
@@ -600,7 +601,10 @@
         u.nick_name, u.user_name, u.email,u.id_card, u.avatar,
         u.birthday,u.orgid,u.job_phone,u.phonenumber, u.sex, u.status
         from healthy_user u
-        <where>
+        where 1=1
+            <if test="orgid != null and orgid != ''">
+                AND orgid = #{orgid}
+            </if>
             <if test="userId != null and userId != 0">
                 AND u.user_id = #{userId}
             </if>
@@ -631,7 +635,6 @@
             <if test="phonenumber != null and phonenumber != ''">
                 AND u.phonenumber like concat('%', #{phonenumber}, '%')
             </if>
-        </where>
     </select>
 
     <select id="selectDeptList" parameterType="com.ruoyi.common.core.domain.entity.SysDept" resultMap="SysDeptResult">
diff --git a/ruoyi-quartz/src/main/resources/mapper/quartz/SysJobLogMapper.xml b/ruoyi-quartz/src/main/resources/mapper/quartz/SysJobLogMapper.xml
index 6353674..6eecd87 100644
--- a/ruoyi-quartz/src/main/resources/mapper/quartz/SysJobLogMapper.xml
+++ b/ruoyi-quartz/src/main/resources/mapper/quartz/SysJobLogMapper.xml
@@ -22,26 +22,28 @@
 
 	<select id="selectJobLogList" parameterType="com.ruoyi.quartz.domain.SysJobLog" resultMap="SysJobLogResult">
 		<include refid="selectJobLogVo"/>
-		<where>
-			<if test="jobName != null and jobName != ''">
-				AND job_name like concat('%', #{jobName}, '%')
-			</if>
-			<if test="jobGroup != null and jobGroup != ''">
-				AND job_group = #{jobGroup}
-			</if>
-			<if test="status != null and status != ''">
-				AND status = #{status}
-			</if>
-			<if test="invokeTarget != null and invokeTarget != ''">
-				AND invoke_target like concat('%', #{invokeTarget}, '%')
-			</if>
-			<if test="params.beginTime != null and params.beginTime != ''"><!-- 寮�濮嬫椂闂存绱� -->
-				and date_format(create_time,'%y%m%d') &gt;= date_format(#{params.beginTime},'%y%m%d')
-			</if>
-			<if test="params.endTime != null and params.endTime != ''"><!-- 缁撴潫鏃堕棿妫�绱� -->
-				and date_format(create_time,'%y%m%d') &lt;= date_format(#{params.endTime},'%y%m%d')
-			</if>
-		</where>
+		where 1=1
+		<if test="orgid != null and orgid != ''">
+			AND orgid = #{orgid}
+		</if>
+		<if test="jobName != null and jobName != ''">
+			AND job_name like concat('%', #{jobName}, '%')
+		</if>
+		<if test="jobGroup != null and jobGroup != ''">
+			AND job_group = #{jobGroup}
+		</if>
+		<if test="status != null and status != ''">
+			AND status = #{status}
+		</if>
+		<if test="invokeTarget != null and invokeTarget != ''">
+			AND invoke_target like concat('%', #{invokeTarget}, '%')
+		</if>
+		<if test="params.beginTime != null and params.beginTime != ''"><!-- 寮�濮嬫椂闂存绱� -->
+			and date_format(create_time,'%y%m%d') &gt;= date_format(#{params.beginTime},'%y%m%d')
+		</if>
+		<if test="params.endTime != null and params.endTime != ''"><!-- 缁撴潫鏃堕棿妫�绱� -->
+			and date_format(create_time,'%y%m%d') &lt;= date_format(#{params.endTime},'%y%m%d')
+		</if>
 	</select>
 
 	<select id="selectJobLogAll" resultMap="SysJobLogResult">
diff --git a/ruoyi-quartz/src/main/resources/mapper/quartz/SysJobMapper.xml b/ruoyi-quartz/src/main/resources/mapper/quartz/SysJobMapper.xml
index 5605c44..afcef79 100644
--- a/ruoyi-quartz/src/main/resources/mapper/quartz/SysJobMapper.xml
+++ b/ruoyi-quartz/src/main/resources/mapper/quartz/SysJobMapper.xml
@@ -27,20 +27,22 @@
 	
 	<select id="selectJobList" parameterType="SysJob" resultMap="SysJobResult">
 		<include refid="selectJobVo"/>
-		<where>
-			<if test="jobName != null and jobName != ''">
-				AND job_name like concat('%', #{jobName}, '%')
-			</if>
-			<if test="jobGroup != null and jobGroup != ''">
-				AND job_group = #{jobGroup}
-			</if>
-			<if test="status != null and status != ''">
-				AND status = #{status}
-			</if>
-			<if test="invokeTarget != null and invokeTarget != ''">
-				AND invoke_target like concat('%', #{invokeTarget}, '%')
-			</if>
-		</where>
+		where 1=1
+		<if test="orgid != null and orgid != ''">
+			AND orgid = #{orgid}
+		</if>
+		<if test="jobName != null and jobName != ''">
+			AND job_name like concat('%', #{jobName}, '%')
+		</if>
+		<if test="jobGroup != null and jobGroup != ''">
+			AND job_group = #{jobGroup}
+		</if>
+		<if test="status != null and status != ''">
+			AND status = #{status}
+		</if>
+		<if test="invokeTarget != null and invokeTarget != ''">
+			AND invoke_target like concat('%', #{invokeTarget}, '%')
+		</if>
 	</select>
 	
 	<select id="selectJobAll" resultMap="SysJobResult">
diff --git a/ruoyi-system/src/main/resources/mapper/system/BaseUserInfoMapper.xml b/ruoyi-system/src/main/resources/mapper/system/BaseUserInfoMapper.xml
index a642513..f3fb8df 100644
--- a/ruoyi-system/src/main/resources/mapper/system/BaseUserInfoMapper.xml
+++ b/ruoyi-system/src/main/resources/mapper/system/BaseUserInfoMapper.xml
@@ -76,7 +76,7 @@
     <select id="selectBaseUserInfoList" parameterType="com.ruoyi.system.domain.BaseUserInfo"
             resultMap="BaseUserInfoResult">
         <include refid="selectBaseUserInfoVo"/>
-        <where>
+        where 1=1
             <if test="usercode != null  and usercode != ''">and usercode = #{usercode}</if>
             <if test="account != null  and account != ''">and account = #{account}</if>
             <if test="guid != null  and guid != ''">and guid = #{guid}</if>
@@ -104,7 +104,6 @@
             <if test="uploadTime != null ">and upload_time = #{uploadTime}</if>
             <if test="deptpermission != null  and deptpermission != ''">and deptpermission = #{deptpermission}</if>
             <if test="wardpermission != null  and wardpermission != ''">and wardpermission = #{wardpermission}</if>
-        </where>
     </select>
 
     <select id="selectBaseUserInfoByUserid" parameterType="Long" resultMap="BaseUserInfoResult">
diff --git a/ruoyi-system/src/main/resources/mapper/system/EquipmentinfoMapper.xml b/ruoyi-system/src/main/resources/mapper/system/EquipmentinfoMapper.xml
index 1efe6f1..ed3a343 100644
--- a/ruoyi-system/src/main/resources/mapper/system/EquipmentinfoMapper.xml
+++ b/ruoyi-system/src/main/resources/mapper/system/EquipmentinfoMapper.xml
@@ -27,7 +27,10 @@
 
     <select id="selectEquipmentinfoList" parameterType="Equipmentinfo" resultMap="EquipmentinfoResult">
         <include refid="selectEquipmentinfoVo"/>
-        <where>  
+        where 1=1
+            <if test="orgid != null and orgid != ''">
+                AND orgid = #{orgid}
+            </if>
             <if test="devtype != null "> and devtype = #{devtype}</if>
             <if test="equipmentname != null  and equipmentname != ''"> and equipmentname like concat('%', #{equipmentname}, '%')</if>
             <if test="modnum != null  and modnum != ''"> and modnum = #{modnum}</if>
@@ -40,7 +43,6 @@
             <if test="storePlace != null  and storePlace != ''"> and storePlace = #{storePlace}</if>
             <if test="technData != null  and technData != ''"> and technData = #{technData}</if>
             <if test="statusid != null "> and statusid = #{statusid}</if>
-        </where>
     </select>
     
     <select id="selectEquipmentinfoById" parameterType="Long" resultMap="EquipmentinfoResult">
diff --git a/ruoyi-system/src/main/resources/mapper/system/SmsParamMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SmsParamMapper.xml
index 76df18d..0224561 100644
--- a/ruoyi-system/src/main/resources/mapper/system/SmsParamMapper.xml
+++ b/ruoyi-system/src/main/resources/mapper/system/SmsParamMapper.xml
@@ -27,7 +27,7 @@
 
     <select id="selectSmsParamList" parameterType="SmsParam" resultMap="SmsParamResult">
         <include refid="selectSmsParamVo"/>
-        <where>
+        where 1=1
             <if test="paramname != null  and paramname != ''"> and paramname like concat('%', #{paramname}, '%')</if>
             <if test="paramval != null  and paramval != ''"> and paramval = #{paramval}</if>
             <if test="descirbe != null  and descirbe != ''"> and descirbe = #{descirbe}</if>
@@ -35,7 +35,6 @@
             <if test="isupload != null "> and isupload = #{isupload}</if>
             <if test="uploadTime != null "> and upload_time = #{uploadTime}</if>
             <if test="orgid != null "> and orgid = #{orgid}</if>
-        </where>
     </select>
 
     <select id="selectSmsParamByParamid" parameterType="Long" resultMap="SmsParamResult">
diff --git a/ruoyi-system/src/main/resources/mapper/system/SmsRecordsMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SmsRecordsMapper.xml
index 5d54eff..7987f5f 100644
--- a/ruoyi-system/src/main/resources/mapper/system/SmsRecordsMapper.xml
+++ b/ruoyi-system/src/main/resources/mapper/system/SmsRecordsMapper.xml
@@ -69,8 +69,8 @@
 
     <select id="selectSmsRecordsList" parameterType="com.ruoyi.system.domain.SmsRecords" resultMap="SmsRecordsResult">
         <include refid="selectSmsRecordsVo"/>
-        <where>
-            del_flag=0
+        where 1=1
+            and del_flag = 0
             <if test="userid != null  and userid != ''">and userid = #{userid}</if>
             <if test="username != null  and username != ''">and username like concat('%', #{username}, '%')</if>
             <if test="phone != null  and phone != ''">and phone = #{phone}</if>
@@ -94,7 +94,6 @@
             <if test="visitTime != null ">and date_format(visit_time,'%y%m%d') =
                 date_format(#{visitTime},'%y%m%d')
             </if>
-        </where>
     </select>
 
     <select id="selectSmsRecordsByRecordid" parameterType="Long" resultMap="SmsRecordsResult">
diff --git a/ruoyi-system/src/main/resources/mapper/system/SmsTempletMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SmsTempletMapper.xml
index 7d3e789..85e32c9 100644
--- a/ruoyi-system/src/main/resources/mapper/system/SmsTempletMapper.xml
+++ b/ruoyi-system/src/main/resources/mapper/system/SmsTempletMapper.xml
@@ -26,13 +26,15 @@
 
     <select id="selectSmsTempletList" parameterType="SmsTemplet" resultMap="SmsTempletResult">
         <include refid="selectSmsTempletVo"/>
-        <where>
+        where 1=1
+            <if test="orgid != null and orgid != ''">
+                AND orgid = #{orgid}
+            </if>
             <if test="templetno != null  and templetno != ''"> and templetno = #{templetno}</if>
             <if test="templetname != null  and templetname != ''"> and templetname like concat('%', #{templetname}, '%')</if>
             <if test="templetcontent != null  and templetcontent != ''"> and templetcontent = #{templetcontent}</if>
             <if test="isupload != null "> and isupload = #{isupload}</if>
             <if test="uploadTime != null "> and upload_time = #{uploadTime}</if>
-        </where>
     </select>
 
     <select id="selectSmsTempletByTempletid" parameterType="Long" resultMap="SmsTempletResult">
diff --git a/ruoyi-system/src/main/resources/mapper/system/SysConfigMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysConfigMapper.xml
index 2c1a4f2..8ee3b05 100644
--- a/ruoyi-system/src/main/resources/mapper/system/SysConfigMapper.xml
+++ b/ruoyi-system/src/main/resources/mapper/system/SysConfigMapper.xml
@@ -36,7 +36,7 @@
 
     <!-- 鏌ヨ鏉′欢 -->
     <sql id="sqlwhereSearch">
-        <where>
+        where 1=1
             <if test="configId !=null">
                 and config_id = #{configId}
             </if>
@@ -46,7 +46,6 @@
             <if test="orgid !=null and orgid != ''">
                 and orgid = #{orgid}
             </if>
-        </where>
     </sql>
 
     <select id="selectConfig" parameterType="SysConfig" resultMap="SysConfigResult">
@@ -56,7 +55,7 @@
 
     <select id="selectConfigList" parameterType="SysConfig" resultMap="SysConfigResult">
         <include refid="selectConfigVo"/>
-        <where>
+        where 1=1
             <if test="configName != null and configName != ''">
                 AND config_name like concat('%', #{configName}, '%')
             </if>
@@ -75,7 +74,6 @@
             <if test="params.endTime != null and params.endTime != ''"><!-- 缁撴潫鏃堕棿妫�绱� -->
                 and date_format(create_time,'%y%m%d') &lt;= date_format(#{params.endTime},'%y%m%d')
             </if>
-        </where>
     </select>
 
     <select id="selectConfigById" parameterType="Long" resultMap="SysConfigResult">
diff --git a/ruoyi-system/src/main/resources/mapper/system/SysDictDataMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysDictDataMapper.xml
index 8c4c61f..e374302 100644
--- a/ruoyi-system/src/main/resources/mapper/system/SysDictDataMapper.xml
+++ b/ruoyi-system/src/main/resources/mapper/system/SysDictDataMapper.xml
@@ -42,7 +42,7 @@
 
     <select id="selectDictDataList" parameterType="SysDictData" resultMap="SysDictDataResult">
         <include refid="selectDictDataVo"/>
-        <where>
+        where 1=1
             <if test="dictType != null and dictType != ''">
                 AND dict_type = #{dictType}
             </if>
@@ -54,10 +54,10 @@
             </if>
             <if test="guid != null and guid != ''">
                 AND guid = #{guid}
-            </if>          <if test="orgid != null and orgid != ''">
+            </if>
+            <if test="orgid != null and orgid != ''">
                 AND orgid = #{orgid}
             </if>
-        </where>
         order by dict_sort asc
     </select>
 
diff --git a/ruoyi-system/src/main/resources/mapper/system/SysDictTypeMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysDictTypeMapper.xml
index 8e3e86f..550a752 100644
--- a/ruoyi-system/src/main/resources/mapper/system/SysDictTypeMapper.xml
+++ b/ruoyi-system/src/main/resources/mapper/system/SysDictTypeMapper.xml
@@ -24,23 +24,25 @@
 
 	<select id="selectDictTypeList" parameterType="SysDictType" resultMap="SysDictTypeResult">
 	    <include refid="selectDictTypeVo"/>
-		<where>
-		    <if test="dictName != null and dictName != ''">
-				AND dict_name like concat('%', #{dictName}, '%')
-			</if>
-			<if test="status != null and status != ''">
-				AND status = #{status}
-			</if>
-			<if test="dictType != null and dictType != ''">
-				AND dict_type like concat('%', #{dictType}, '%')
-			</if>
-			<if test="params.beginTime != null and params.beginTime != ''"><!-- 寮�濮嬫椂闂存绱� -->
-				and date_format(create_time,'%y%m%d') &gt;= date_format(#{params.beginTime},'%y%m%d')
-			</if>
-			<if test="params.endTime != null and params.endTime != ''"><!-- 缁撴潫鏃堕棿妫�绱� -->
-				and date_format(create_time,'%y%m%d') &lt;= date_format(#{params.endTime},'%y%m%d')
-			</if>
-	    </where>
+		where 1=1
+		<if test="orgid != null and orgid != ''">
+			AND orgid = #{orgid}
+		</if>
+		<if test="dictName != null and dictName != ''">
+			AND dict_name like concat('%', #{dictName}, '%')
+		</if>
+		<if test="status != null and status != ''">
+			AND status = #{status}
+		</if>
+		<if test="dictType != null and dictType != ''">
+			AND dict_type like concat('%', #{dictType}, '%')
+		</if>
+		<if test="params.beginTime != null and params.beginTime != ''"><!-- 寮�濮嬫椂闂存绱� -->
+			and date_format(create_time,'%y%m%d') &gt;= date_format(#{params.beginTime},'%y%m%d')
+		</if>
+		<if test="params.endTime != null and params.endTime != ''"><!-- 缁撴潫鏃堕棿妫�绱� -->
+			and date_format(create_time,'%y%m%d') &lt;= date_format(#{params.endTime},'%y%m%d')
+		</if>
 	</select>
 
 	<select id="selectDictTypeAll" resultMap="SysDictTypeResult">
diff --git a/ruoyi-system/src/main/resources/mapper/system/SysLogininforMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysLogininforMapper.xml
index a0f071f..e6c284c 100644
--- a/ruoyi-system/src/main/resources/mapper/system/SysLogininforMapper.xml
+++ b/ruoyi-system/src/main/resources/mapper/system/SysLogininforMapper.xml
@@ -25,23 +25,25 @@
 
 	<select id="selectLogininforList" parameterType="SysLogininfor" resultMap="SysLogininforResult">
 		select info_id, user_name, ipaddr, login_location, browser, os, status, msg, login_time from sys_logininfor
-		<where>
-			<if test="ipaddr != null and ipaddr != ''">
-				AND ipaddr like concat('%', #{ipaddr}, '%')
-			</if>
-			<if test="status != null and status != ''">
-				AND status = #{status}
-			</if>
-			<if test="userName != null and userName != ''">
-				AND user_name like concat('%', #{userName}, '%')
-			</if>
-			<if test="params.beginTime != null and params.beginTime != ''"><!-- 寮�濮嬫椂闂存绱� -->
-				and date_format(login_time,'%y%m%d') &gt;= date_format(#{params.beginTime},'%y%m%d')
-			</if>
-			<if test="params.endTime != null and params.endTime != ''"><!-- 缁撴潫鏃堕棿妫�绱� -->
-				and date_format(login_time,'%y%m%d') &lt;= date_format(#{params.endTime},'%y%m%d')
-			</if>
-		</where>
+		where 1=1
+		<if test="orgid != null and orgid != ''">
+			AND orgid = #{orgid}
+		</if>
+		<if test="ipaddr != null and ipaddr != ''">
+			AND ipaddr like concat('%', #{ipaddr}, '%')
+		</if>
+		<if test="status != null and status != ''">
+			AND status = #{status}
+		</if>
+		<if test="userName != null and userName != ''">
+			AND user_name like concat('%', #{userName}, '%')
+		</if>
+		<if test="params.beginTime != null and params.beginTime != ''"><!-- 寮�濮嬫椂闂存绱� -->
+			and date_format(login_time,'%y%m%d') &gt;= date_format(#{params.beginTime},'%y%m%d')
+		</if>
+		<if test="params.endTime != null and params.endTime != ''"><!-- 缁撴潫鏃堕棿妫�绱� -->
+			and date_format(login_time,'%y%m%d') &lt;= date_format(#{params.endTime},'%y%m%d')
+		</if>
 		order by info_id desc
 	</select>
 
diff --git a/ruoyi-system/src/main/resources/mapper/system/SysMenuMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysMenuMapper.xml
index 71653f4..bc90913 100644
--- a/ruoyi-system/src/main/resources/mapper/system/SysMenuMapper.xml
+++ b/ruoyi-system/src/main/resources/mapper/system/SysMenuMapper.xml
@@ -52,7 +52,7 @@
 
     <select id="selectMenuList" parameterType="SysMenu" resultMap="SysMenuResult">
         <include refid="selectMenuVo"/>
-        <where>
+        where 1=1
             <if test="menuName != null and menuName != ''">
                 AND menu_name like concat('%', #{menuName}, '%')
             </if>
@@ -62,7 +62,9 @@
             <if test="status != null and status != ''">
                 AND status = #{status}
             </if>
-        </where>
+            <if test="orgid != null and orgid != ''">
+                AND orgid = #{orgid}
+            </if>
         order by parent_id, order_num
     </select>
 
diff --git a/ruoyi-system/src/main/resources/mapper/system/SysNoticeMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysNoticeMapper.xml
index cd51b5a..8ab9dd0 100644
--- a/ruoyi-system/src/main/resources/mapper/system/SysNoticeMapper.xml
+++ b/ruoyi-system/src/main/resources/mapper/system/SysNoticeMapper.xml
@@ -42,7 +42,7 @@
 
     <select id="selectNoticeList" parameterType="SysNotice" resultMap="SysNoticeResult">
         <include refid="selectNoticeVo"/>
-        <where>
+        where 1=1
             <if test="noticeTitle != null and noticeTitle != ''">
                 AND notice_title like concat('%', #{noticeTitle}, '%')
             </if>
@@ -52,10 +52,9 @@
             <if test="createBy != null and createBy != ''">
                 AND create_by like concat('%', #{createBy}, '%')
             </if>
-                   <if test="orgid != null and orgid != ''">
+            <if test="orgid != null and orgid != ''">
                 AND orgid = #{orgid}
             </if>
-        </where>
     </select>
 
     <insert id="insertNotice" parameterType="SysNotice">
diff --git a/ruoyi-system/src/main/resources/mapper/system/SysOperLogMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysOperLogMapper.xml
index 51c3d11..b95843f 100644
--- a/ruoyi-system/src/main/resources/mapper/system/SysOperLogMapper.xml
+++ b/ruoyi-system/src/main/resources/mapper/system/SysOperLogMapper.xml
@@ -37,32 +37,34 @@
 
 	<select id="selectOperLogList" parameterType="SysOperLog" resultMap="SysOperLogResult">
 		<include refid="selectOperLogVo"/>
-		<where>
-			<if test="title != null and title != ''">
-				AND title like concat('%', #{title}, '%')
-			</if>
-			<if test="businessType != null">
-				AND business_type = #{businessType}
-			</if>
-			<if test="businessTypes != null and businessTypes.length > 0">
-			    AND business_type in
-			    <foreach collection="businessTypes" item="businessType" open="(" separator="," close=")">
-		 			#{businessType}
-		        </foreach>
-			</if>
-			<if test="status != null">
-				AND status = #{status}
-			</if>
-			<if test="operName != null and operName != ''">
-				AND oper_name like concat('%', #{operName}, '%')
-			</if>
-			<if test="params.beginTime != null and params.beginTime != ''"><!-- 寮�濮嬫椂闂存绱� -->
-				and date_format(oper_time,'%y%m%d') &gt;= date_format(#{params.beginTime},'%y%m%d')
-			</if>
-			<if test="params.endTime != null and params.endTime != ''"><!-- 缁撴潫鏃堕棿妫�绱� -->
-				and date_format(oper_time,'%y%m%d') &lt;= date_format(#{params.endTime},'%y%m%d')
-			</if>
-		</where>
+		where 1=1
+		<if test="orgid != null and orgid != ''">
+			AND orgid = #{orgid}
+		</if>
+		<if test="title != null and title != ''">
+			AND title like concat('%', #{title}, '%')
+		</if>
+		<if test="businessType != null">
+			AND business_type = #{businessType}
+		</if>
+		<if test="businessTypes != null and businessTypes.length > 0">
+			AND business_type in
+			<foreach collection="businessTypes" item="businessType" open="(" separator="," close=")">
+				#{businessType}
+			</foreach>
+		</if>
+		<if test="status != null">
+			AND status = #{status}
+		</if>
+		<if test="operName != null and operName != ''">
+			AND oper_name like concat('%', #{operName}, '%')
+		</if>
+		<if test="params.beginTime != null and params.beginTime != ''"><!-- 寮�濮嬫椂闂存绱� -->
+			and date_format(oper_time,'%y%m%d') &gt;= date_format(#{params.beginTime},'%y%m%d')
+		</if>
+		<if test="params.endTime != null and params.endTime != ''"><!-- 缁撴潫鏃堕棿妫�绱� -->
+			and date_format(oper_time,'%y%m%d') &lt;= date_format(#{params.endTime},'%y%m%d')
+		</if>
 		order by oper_id desc
 	</select>
 
diff --git a/ruoyi-system/src/main/resources/mapper/system/SysPostMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysPostMapper.xml
index e2df278..fd22928 100644
--- a/ruoyi-system/src/main/resources/mapper/system/SysPostMapper.xml
+++ b/ruoyi-system/src/main/resources/mapper/system/SysPostMapper.xml
@@ -35,7 +35,10 @@
 
     <select id="selectPostList" parameterType="com.ruoyi.system.domain.SysPost" resultMap="SysPostResult">
         <include refid="selectPostVo"/>
-        <where>
+        where 1=1
+            <if test="orgid != null and orgid != ''">
+                AND orgid = #{orgid}
+            </if>
             <if test="postCode != null and postCode != ''">
                 AND post_code like concat('%', #{postCode}, '%')
             </if>
@@ -48,7 +51,6 @@
             <if test="postName != null and postName != ''">
                 AND post_name like concat('%', #{postName}, '%')
             </if>
-        </where>
     </select>
 
     <select id="selectPostAll" resultMap="SysPostResult">
diff --git a/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml
index 79c0fec..b61d615 100644
--- a/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml
+++ b/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml
@@ -301,15 +301,14 @@
 
     <select id="selectUserByUserNameByCondition" parameterType="String" resultMap="SysUserResult">
         <include refid="selectUserVo"/>
-        <where>
-            u.del_flag = '0'
+        where 1=1
+            AND u.del_flag = '0'
             <if test="userName != null and userName != ''">
                 AND u.user_name = #{userName}
             </if>
             <if test="deptId != null and deptId != ''">
                 AND u.dept_id = #{deptId}
             </if>
-        </where>
     </select>
 
     <select id="selectUserById" parameterType="Long" resultMap="SysUserResult">
diff --git a/smartor/src/main/resources/mapper/smartor/BaseDictOperationMapper.xml b/smartor/src/main/resources/mapper/smartor/BaseDictOperationMapper.xml
index 9de5a95..99c81d5 100644
--- a/smartor/src/main/resources/mapper/smartor/BaseDictOperationMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/BaseDictOperationMapper.xml
@@ -54,7 +54,7 @@
     <select id="selectBaseDictOperationList" parameterType="com.smartor.domain.BaseDictOperation"
             resultMap="BaseDictOperationResult">
         <include refid="selectBaseDictOperationVo"/>
-        <where>
+        where 1=1
             <if test="opid != null ">
                 and opid = #{opid}
             </if>
@@ -97,7 +97,6 @@
             <if test="pid != null ">
                 and pid = #{pid}
             </if>
-        </where>
     </select>
 
     <select id="selectBaseDictOperationById" parameterType="Long"
diff --git a/smartor/src/main/resources/mapper/smartor/BaseOrganizationMapper.xml b/smartor/src/main/resources/mapper/smartor/BaseOrganizationMapper.xml
index eacaf7f..68ef410 100644
--- a/smartor/src/main/resources/mapper/smartor/BaseOrganizationMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/BaseOrganizationMapper.xml
@@ -84,8 +84,8 @@
     <select id="selectBaseOrganizationList" parameterType="com.smartor.domain.BaseOrganization"
             resultMap="BaseOrganizationResult">
         <include refid="selectBaseOrganizationVo"/>
-        <where>
-            del_flag=0
+        where 1=1
+            and del_flag = 0
             <if test="OrganizationName != null  and OrganizationName != ''">
                 and OrganizationName like concat('%', #{OrganizationName}, '%')
             </if>
@@ -173,7 +173,6 @@
             <if test="orgid != null ">
                 and orgid = #{orgid}
             </if>
-        </where>
     </select>
 
     <select id="selectBaseOrganizationByID" parameterType="Long"
diff --git a/smartor/src/main/resources/mapper/smartor/BaseSmsaccountMapper.xml b/smartor/src/main/resources/mapper/smartor/BaseSmsaccountMapper.xml
index da4fecc..b52dde2 100644
--- a/smartor/src/main/resources/mapper/smartor/BaseSmsaccountMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/BaseSmsaccountMapper.xml
@@ -43,7 +43,7 @@
 
     <select id="selectBaseSmsaccountList" parameterType="BaseSmsaccount" resultMap="BaseSmsaccountResult">
         <include refid="selectBaseSmsaccountVo"/>
-        <where>
+        where 1=1
             <if test="smsname != null  and smsname != ''">and smsname like concat('%', #{smsname}, '%')</if>
             <if test="account != null  and account != ''">and account = #{account}</if>
             <if test="password != null  and password != ''">and password = #{password}</if>
@@ -51,7 +51,6 @@
             <if test="isupload != null ">and isupload = #{isupload}</if>
             <if test="uploadTime != null ">and upload_time = #{uploadTime}</if>
             <if test="isenable != null ">and isenable = #{isenable}</if>
-        </where>
     </select>
 
     <select id="selectBaseSmsaccountBySmsacountid" parameterType="Long" resultMap="BaseSmsaccountResult">
diff --git a/smartor/src/main/resources/mapper/smartor/BaseTagMapper.xml b/smartor/src/main/resources/mapper/smartor/BaseTagMapper.xml
index f1e3884..7f0d50f 100644
--- a/smartor/src/main/resources/mapper/smartor/BaseTagMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/BaseTagMapper.xml
@@ -41,7 +41,7 @@
 
     <select id="selectBaseTagList" parameterType="com.smartor.domain.BaseTag" resultMap="BaseTagResult">
         <include refid="selectBaseTagVo"/>
-        <where>
+        where 1=1
             <if test="tagcategoryid != null ">and tagcategoryid = #{tagcategoryid}</if>
             <if test="tagname != null  and tagname != ''">and tagname like concat('%', #{tagname}, '%')</if>
             <if test="tagdescription != null  and tagdescription != ''">and tagdescription = #{tagdescription}</if>
@@ -49,11 +49,10 @@
             <if test="isupload != null ">and isupload = #{isupload}</if>
             <if test="uploadTime != null ">and upload_time = #{uploadTime}</if>
             <if test="isenable != null ">and isenable = #{isenable}</if>
-        </where>
     </select>
     <select id="selectBaseTagListByTagname" parameterType="com.smartor.domain.BaseTag" resultMap="BaseTagResult">
         <include refid="selectBaseTagVo"/>
-        <where>
+        where 1=1
             <if test="tagcategoryid != null ">and tagcategoryid = #{tagcategoryid}</if>
             <if test="tagname != null  and tagname != ''">and tagname =#{tagname}</if>
             <if test="tagdescription != null  and tagdescription != ''">and tagdescription = #{tagdescription}</if>
@@ -61,7 +60,6 @@
             <if test="isupload != null ">and isupload = #{isupload}</if>
             <if test="uploadTime != null ">and upload_time = #{uploadTime}</if>
             <if test="isenable != null ">and isenable = #{isenable}</if>
-        </where>
     </select>
 
     <select id="selectBaseTagByTagid" parameterType="Long" resultMap="BaseTagResult">
diff --git a/smartor/src/main/resources/mapper/smartor/BaseTagcategoryMapper.xml b/smartor/src/main/resources/mapper/smartor/BaseTagcategoryMapper.xml
index 19f75e8..b6ad55c 100644
--- a/smartor/src/main/resources/mapper/smartor/BaseTagcategoryMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/BaseTagcategoryMapper.xml
@@ -40,7 +40,7 @@
     <select id="selectBaseTagcategoryList" parameterType="com.smartor.domain.BaseTagcategory"
             resultMap="BaseTagcategoryResult">
         <include refid="selectBaseTagcategoryVo"/>
-        <where>
+        where 1=1
             <if test="orgid != null  and orgid != ''">and orgid = #{orgid}</if>
             <if test="pym != null  and pym != ''">and pym = #{pym}</if>
             <if test="wbm != null  and wbm != ''">and wbm = #{wbm}</if>
@@ -49,7 +49,6 @@
             <if test="categoryname != null  and categoryname != ''">and categoryname like concat('%', #{categoryname},
                 '%')
             </if>
-        </where>
     </select>
 
     <select id="selectBaseTagcategoryByTagcategoryid" parameterType="Long" resultMap="BaseTagcategoryResult">
@@ -129,11 +128,14 @@
         count(b.tagid) as tagNum
         from base_tagcategory a left join base_tag b
         on a.tagcategoryid = b.tagcategoryid
-        <where>
-            <if test="categoryname != null  and categoryname != ''">a.categoryname like concat('%', #{categoryname},
-                '%')
-            </if>
-        </where>
+        where 1=1
+        <if test="categoryname != null  and categoryname != ''">
+            and a.categoryname like concat('%', #{categoryname},
+            '%')
+        </if>
+        <if test="orgid != null and orgid != ''">
+            and a.orgid = #{orgid}
+        </if>
         GROUP BY a.tagcategoryid,a.categoryname
     </select>
 </mapper>
diff --git a/smartor/src/main/resources/mapper/smartor/HNGatherPatArchiveMapper.xml b/smartor/src/main/resources/mapper/smartor/HNGatherPatArchiveMapper.xml
index 30fe095..3a197f4 100644
--- a/smartor/src/main/resources/mapper/smartor/HNGatherPatArchiveMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/HNGatherPatArchiveMapper.xml
@@ -367,25 +367,25 @@
     <select id="yhyjsxx" parameterType="com.ruoyi.common.core.domain.entity.SysUser" resultMap="SysUserRoleResult">
         select user_id, role_id, orgid
         FROM yhyjsxx
-        <where>
-            <if test="hisUserId != null ">and user_id = #{hisUserId}</if>
-        </where>
+        where 1=1
+        <if test="hisUserId != null ">
+            and user_id = #{hisUserId}
+        </if>
     </select>
 
     <select id="yhyksxx" parameterType="com.ruoyi.common.core.domain.entity.SysUser" resultMap="SysUserDeptResult">
         select user_id, user_code, dept_type,department_id as
         dept_id,dept_name,deptparent,del_flag,orgid,create_time,create_by,update_time,update_by
         FROM yhyksxx
-        <where>
-            user_id != 'admin'
+        where 1=1
+            and user_id != 'admin'
             <if test="hisUserId != null ">and user_id = #{hisUserId}</if>
-        </where>
     </select>
 
 
     <select id="selectPatArchiveList" parameterType="com.smartor.domain.PatArchive" resultMap="PatArchiveResult">
         <include refid="selectPatArchiveVo"/>
-        <where>
+        where 1=1
             <if test="name != null  and name != ''">and name like concat('%', #{name}, '%')</if>
             <if test="idcardno != null  and idcardno != ''">and idcardno = #{idcardno}</if>
             <if test="sourcefrom != null ">and sourcefrom = #{sourcefrom}</if>
@@ -415,7 +415,6 @@
             <if test="casePersonAge != null ">and case_person_age = #{casePersonAge}</if>
             <if test="filterDrname != null ">and filter_drname = #{filterDrname}</if>
             <if test="filterDrcode != null ">and filter_drcode = #{filterDrcode}</if>
-        </where>
     </select>
 
 
@@ -494,8 +493,7 @@
         b.fuadvice
         FROM
         cryxx b
-        <where>
-
+        where 1=1
             <if test="startOutHospTime != null ">and to_char(b.endtime,'YYMMDD') &gt;=
                 to_char(#{startOutHospTime}::date,'YYMMDD')
             </if>
@@ -518,7 +516,6 @@
             <if test="outWayId != null ">and b.out_way_id = #{outWayId}</if>
             <if test="outWayName != null ">and b.out_way_name = #{outWayName}</if>
             <if test="orgid != null ">and b.orgid = #{orgid}</if>
-        </where>
     </select>
 
 
@@ -552,8 +549,7 @@
         patname,
         mainsuit
         from mzxx
-        <where>
-
+        where 1=1
             <if test="beginTime != null ">and to_char( admitdate,'YYMMDD') &gt;=
                 to_char(#{beginTime}::date,'YYMMDD')
             </if>
@@ -561,7 +557,6 @@
                 to_char(#{endTime}::date,'YYMMDD')
             </if>
 
-        </where>
     </select>
 
 
@@ -574,7 +569,7 @@
         icdname,
         icdpym
         from jbxx
-        <where>
+        where 1=1
             <if test="icdcode != null  and icdcode != ''">and icdcode = #{icdcode}</if>
             <if test="lastflag != null  and lastflag != ''">and lastflag = #{lastflag}</if>
             <if test="chimedflag != null  and chimedflag != ''">and chimedflag = #{chimedflag}</if>
@@ -585,7 +580,6 @@
             <if test="pid != null ">and pid = #{pid}</if>
             <if test="guid != null  and guid != ''">and guid = #{guid}</if>
             <if test="hisIcdid != null  and hisIcdid != ''">and his_icdid = #{hisIcdid}</if>
-        </where>
     </select>
 
 
@@ -596,7 +590,7 @@
         u.birthday,u.orgid,u.job_phone,u.phonenumber, u.sex, u.status,
         u.login_ip, u.login_date, u.create_by, u.create_time, u.remark
         from ryxx u
-        <where>
+        where 1=1
             <if test="userId != null and userId != 0">
                 AND u.user_id = #{userId}
             </if>
@@ -627,7 +621,6 @@
             <if test="phonenumber != null and phonenumber != ''">
                 AND u.phonenumber like concat('%', #{phonenumber}, '%')
             </if>
-        </where>
     </select>
 
     <select id="selectDeptList" parameterType="com.ruoyi.common.core.domain.entity.SysDept" resultMap="SysDeptResult">
diff --git a/smartor/src/main/resources/mapper/smartor/HeCategoryMapper.xml b/smartor/src/main/resources/mapper/smartor/HeCategoryMapper.xml
index 9604209..518abfe 100644
--- a/smartor/src/main/resources/mapper/smartor/HeCategoryMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/HeCategoryMapper.xml
@@ -37,14 +37,13 @@
 
     <select id="selectHeCategoryList" parameterType="com.smartor.domain.HeCategory" resultMap="HeCategoryResult">
         <include refid="selectHeCategoryVo"/>
-        <where>
+        where 1=1
             <if test="categoryname != null  and categoryname != ''">and categoryname like concat('%', #{categoryname},
                 '%')
             </if>
             <if test="orgid != null  and orgid != ''">and orgid = #{orgid}</if>
             <if test="id != null">and id = #{id}</if>
             <if test="pid != null">and pid = #{pid}</if>
-        </where>
     </select>
 
     <select id="selectHeCategoryById" parameterType="Long" resultMap="HeCategoryResult">
diff --git a/smartor/src/main/resources/mapper/smartor/HeLibraryAssortMapper.xml b/smartor/src/main/resources/mapper/smartor/HeLibraryAssortMapper.xml
index c74078e..ad40e83 100644
--- a/smartor/src/main/resources/mapper/smartor/HeLibraryAssortMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/HeLibraryAssortMapper.xml
@@ -42,8 +42,8 @@
     <select id="selectHeLibraryAssortList" parameterType="com.smartor.domain.HeLibraryAssort"
             resultMap="HeLibraryAssortResult">
         <include refid="selectHeLibraryAssortVo"/>
-        <where>
-            del_flag != 1
+        where 1=1
+            and del_flag != 1
             <if test="assortname != null  and assortname != ''">and assortname like concat('%', #{assortname}, '%')</if>
             <if test="orgid != null  and orgid != ''">and orgid = #{orgid}</if>
             <if test="isupload != null ">and isupload = #{isupload}</if>
@@ -53,7 +53,6 @@
             <if test="seqno != null  ">and seqno = #{seqno}</if>
             <if test="hetype != null  ">and hetype = #{hetype}</if>
 
-        </where>
         order by seqno asc
     </select>
 
diff --git a/smartor/src/main/resources/mapper/smartor/HeLibraryMapper.xml b/smartor/src/main/resources/mapper/smartor/HeLibraryMapper.xml
index 2df9355..b29cd48 100644
--- a/smartor/src/main/resources/mapper/smartor/HeLibraryMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/HeLibraryMapper.xml
@@ -85,8 +85,8 @@
 
     <select id="selectHeLibraryList" parameterType="com.smartor.domain.HeLibrary" resultMap="HeLibraryResult">
         <include refid="selectHeLibraryVo"/>
-        <where>
-            del_flag=0
+        where 1=1
+            and del_flag = 0
             <if test="id != null ">and id = #{id}</if>
             <if test="classification != null  and classification != ''">and classification = #{classification}</if>
             <if test="assortid != null ">and assortid = #{assortid}</if>
@@ -121,7 +121,6 @@
             <if test="richText != null  and richText != ''">and rich_text = #{richText}</if>
             <if test="hetype != null  and hetype != ''">and hetype = #{hetype}</if>
             <if test="htmlRichText != null  and htmlRichText != ''">and html_rich_text = #{htmlRichText}</if>
-        </where>
     </select>
 
     <select id="selectHeLibraryById" parameterType="Long" resultMap="HeLibraryResult">
diff --git a/smartor/src/main/resources/mapper/smartor/HeLibraryTagMapper.xml b/smartor/src/main/resources/mapper/smartor/HeLibraryTagMapper.xml
index 9db09a7..d09c427 100644
--- a/smartor/src/main/resources/mapper/smartor/HeLibraryTagMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/HeLibraryTagMapper.xml
@@ -43,8 +43,8 @@
 
     <select id="selectHeLibraryTagList" parameterType="com.smartor.domain.HeLibraryTag" resultMap="HeLibraryTagResult">
         <include refid="selectHeLibraryTagVo"/>
-        <where>
-            del_flag=0
+        where 1=1
+            and del_flag = 0
             <if test="tagcategoryid != null ">and tagcategoryid = #{tagcategoryid}</if>
             <if test="tagid != null ">and tagid = #{tagid}</if>
             <if test="orgid != null  and orgid != ''">and orgid = #{orgid}</if>
@@ -54,7 +54,6 @@
             <if test="pid != null ">and pid = #{pid}</if>
             <if test="guid != null  and guid != ''">and guid = #{guid}</if>
             <if test="tagname != null  and tagname != ''">and tagname = #{tagname}</if>
-        </where>
     </select>
 
     <select id="selectHeLibraryTagById" parameterType="Long" resultMap="HeLibraryTagResult">
diff --git a/smartor/src/main/resources/mapper/smartor/HeLocallibraryMapper.xml b/smartor/src/main/resources/mapper/smartor/HeLocallibraryMapper.xml
index 1bb682f..938cf00 100644
--- a/smartor/src/main/resources/mapper/smartor/HeLocallibraryMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/HeLocallibraryMapper.xml
@@ -61,8 +61,8 @@
     <select id="selectHeLocallibraryList" parameterType="com.smartor.domain.HeLocallibrary"
             resultMap="HeLocallibraryResult">
         <include refid="selectHeLocallibraryVo"/>
-        <where>
-            del_flag=0
+        where 1=1
+            and del_flag = 0
             <if test="preachcategoryid != null ">and preachcategoryid = #{preachcategoryid}</if>
             <if test="preachname != null  and preachname != ''">and preachname like concat('%', #{preachname}, '%')</if>
             <if test="version != null ">and version = #{version}</if>
@@ -83,7 +83,6 @@
             <if test="centerlibrarycode != null  and centerlibrarycode != ''">and centerlibrarycode =
                 #{centerlibrarycode}
             </if>
-        </where>
     </select>
 
     <select id="selectHeLocallibraryById" parameterType="Long" resultMap="HeLocallibraryResult">
diff --git a/smartor/src/main/resources/mapper/smartor/HospitalRecordMapper.xml b/smartor/src/main/resources/mapper/smartor/HospitalRecordMapper.xml
index 7bbd5a9..3648ada 100644
--- a/smartor/src/main/resources/mapper/smartor/HospitalRecordMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/HospitalRecordMapper.xml
@@ -134,7 +134,7 @@
     <select id="selectHospitalRecordList" parameterType="com.smartor.domain.HospitalRecord"
             resultMap="HospitalRecordResult">
         <include refid="selectHospitalRecordVo"/>
-        <where>
+        where 1=1
             <if test="ID != null  and ID != ''">and ID = #{ID}</if>
             <if test="sourceSystem != null  and sourceSystem != ''">and SourceSystem = #{sourceSystem}</if>
             <if test="messageID != null  and messageID != ''">and MessageID = #{messageID}</if>
@@ -214,7 +214,6 @@
             </if>
             <if test="taskStatus != null  and taskStatus != ''">and taskStatus = #{taskStatus}</if>
             <if test="orgid != null  and orgid != ''">and orgid = #{orgid}</if>
-        </where>
     </select>
 
     <select id="selectHospitalRecordByID" parameterType="String" resultMap="HospitalRecordResult">
diff --git a/smartor/src/main/resources/mapper/smartor/HospitalUserinfoMapper.xml b/smartor/src/main/resources/mapper/smartor/HospitalUserinfoMapper.xml
index 3a23219..e5a3771 100644
--- a/smartor/src/main/resources/mapper/smartor/HospitalUserinfoMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/HospitalUserinfoMapper.xml
@@ -183,7 +183,7 @@
 
     <select id="selectHospitalUserinfoList" parameterType="HospitalUserinfo" resultMap="HospitalUserinfoResult">
         <include refid="selectHospitalUserinfoVo"/>
-        <where>
+        where 1=1
             <if test="SourceSystem != null  and SourceSystem != ''">and SourceSystem = #{SourceSystem}</if>
             <if test="MessageID != null  and MessageID != ''">and MessageID = #{MessageID}</if>
             <if test="CreateTime != null  and CreateTime != ''">and CreateTime = #{CreateTime}</if>
@@ -283,7 +283,6 @@
             <if test="Bednur != null  and Bednur != ''">and Bednur = #{Bednur}</if>
             <if test="Regdoc != null  and Regdoc != ''">and Regdoc = #{Regdoc}</if>
             <if test="orgid != null  and orgid != ''">and orgid = #{orgid}</if>
-        </where>
     </select>
 
     <select id="selectHospitalUserinfoByID" parameterType="Long" resultMap="HospitalUserinfoResult">
diff --git a/smartor/src/main/resources/mapper/smartor/Icd10AssociationMapper.xml b/smartor/src/main/resources/mapper/smartor/Icd10AssociationMapper.xml
index ebba189..6be7842 100644
--- a/smartor/src/main/resources/mapper/smartor/Icd10AssociationMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/Icd10AssociationMapper.xml
@@ -59,7 +59,7 @@
     <select id="selectIcd10AssociationList" parameterType="com.smartor.domain.Icd10Association"
             resultMap="Icd10AssociationResult">
         <include refid="selectIcd10AssociationVo"/>
-        <where>
+        where 1=1
             <if test="icd10id != null ">and icd10id = #{icd10id}</if>
             <if test="icd10code != null and icd10code != ''">and icd10code = #{icd10code}</if>
             <if test="orgid != null  and orgid != ''">and orgid = #{orgid}</if>
@@ -83,7 +83,6 @@
             </if>
             <if test="outpatientUseAssort != null">and outpatient_use_assort = #{outpatientUseAssort}</if>
             <if test="inpatientUseAssort != null">and inpatient_use_assort = #{inpatientUseAssort}</if>
-        </where>
     </select>
 
     <select id="selectIcd10AssociationById" parameterType="Long" resultMap="Icd10AssociationResult">
diff --git a/smartor/src/main/resources/mapper/smartor/Icd10Mapper.xml b/smartor/src/main/resources/mapper/smartor/Icd10Mapper.xml
index ef995e2..3c97d8e 100644
--- a/smartor/src/main/resources/mapper/smartor/Icd10Mapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/Icd10Mapper.xml
@@ -45,8 +45,8 @@
 
     <select id="selectIcd10List" parameterType="com.smartor.domain.Icd10" resultMap="Icd10Result">
         <include refid="selectIcd10Vo"/>
-        <where>
-            del_flag=0
+        where 1=1
+            and del_flag = 0
             <if test="icdcode != null  and icdcode != ''">and icdcode = #{icdcode}</if>
             <if test="lastflag != null  and lastflag != ''">and lastflag = #{lastflag}</if>
             <if test="chimedflag != null  and chimedflag != ''">and chimedflag = #{chimedflag}</if>
@@ -57,7 +57,6 @@
             <if test="pid != null ">and pid = #{pid}</if>
             <if test="guid != null  and guid != ''">and guid = #{guid}</if>
             <if test="hisIcdid != null  and hisIcdid != ''">and his_icdid = #{hisIcdid}</if>
-        </where>
     </select>
 
     <select id="selectIcd10ByIcdid" parameterType="Long" resultMap="Icd10Result">
diff --git a/smartor/src/main/resources/mapper/smartor/IvrLibIntentMapper.xml b/smartor/src/main/resources/mapper/smartor/IvrLibIntentMapper.xml
index 958ecb9..8757c92 100644
--- a/smartor/src/main/resources/mapper/smartor/IvrLibIntentMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/IvrLibIntentMapper.xml
@@ -27,7 +27,7 @@
 
     <select id="selectIvrLibIntentList" parameterType="IvrLibIntent" resultMap="IvrLibIntentResult">
         <include refid="selectIvrLibIntentVo"/>
-        <where>
+        where 1=1
             <if test="orgid != null  and orgid != ''"> and orgid = #{orgid}</if>
             <if test="intentionname != null  and intentionname != ''"> and intentionname like concat('%', #{intentionname}, '%')</if>
             <if test="categoryid != null "> and categoryid = #{categoryid}</if>
@@ -35,7 +35,6 @@
             <if test="intentionword != null  and intentionword != ''"> and intentionword = #{intentionword}</if>
             <if test="isupload != null "> and isupload = #{isupload}</if>
             <if test="uploadTime != null "> and upload_time = #{uploadTime}</if>
-        </where>
     </select>
 
     <select id="selectIvrLibIntentByIntentid" parameterType="Long" resultMap="IvrLibIntentResult">
diff --git a/smartor/src/main/resources/mapper/smartor/IvrLibIntentcategoryMapper.xml b/smartor/src/main/resources/mapper/smartor/IvrLibIntentcategoryMapper.xml
index 6855113..426c562 100644
--- a/smartor/src/main/resources/mapper/smartor/IvrLibIntentcategoryMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/IvrLibIntentcategoryMapper.xml
@@ -24,12 +24,11 @@
 
     <select id="selectIvrLibIntentcategoryList" parameterType="IvrLibIntentcategory" resultMap="IvrLibIntentcategoryResult">
         <include refid="selectIvrLibIntentcategoryVo"/>
-        <where>
+        where 1=1
             <if test="categoryname != null  and categoryname != ''"> and categoryname like concat('%', #{categoryname}, '%')</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>
-        </where>
     </select>
 
     <select id="selectIvrLibIntentcategoryByIntertcatid" parameterType="Long" resultMap="IvrLibIntentcategoryResult">
diff --git a/smartor/src/main/resources/mapper/smartor/IvrLibScriptMapper.xml b/smartor/src/main/resources/mapper/smartor/IvrLibScriptMapper.xml
index fe2191c..bfd2207 100644
--- a/smartor/src/main/resources/mapper/smartor/IvrLibScriptMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/IvrLibScriptMapper.xml
@@ -29,7 +29,7 @@
 
     <select id="selectIvrLibScriptList" parameterType="IvrLibScript" resultMap="IvrLibScriptResult">
         <include refid="selectIvrLibScriptVo"/>
-        <where>
+        where 1=1
             <if test="orgid != null  and orgid != ''"> and orgid = #{orgid}</if>
             <if test="categoryid != null "> and categoryid = #{categoryid}</if>
             <if test="categoryname != null  and categoryname != ''"> and categoryname like concat('%', #{categoryname}, '%')</if>
@@ -39,7 +39,6 @@
             <if test="speakname != null  and speakname != ''"> and speakname like concat('%', #{speakname}, '%')</if>
             <if test="isupload != null "> and isupload = #{isupload}</if>
             <if test="uploadTime != null "> and upload_time = #{uploadTime}</if>
-        </where>
     </select>
 
     <select id="selectIvrLibScriptByScriptid" parameterType="Long" resultMap="IvrLibScriptResult">
diff --git a/smartor/src/main/resources/mapper/smartor/IvrLibScriptcategoryMapper.xml b/smartor/src/main/resources/mapper/smartor/IvrLibScriptcategoryMapper.xml
index 56b2e9b..1da8d87 100644
--- a/smartor/src/main/resources/mapper/smartor/IvrLibScriptcategoryMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/IvrLibScriptcategoryMapper.xml
@@ -24,12 +24,11 @@
 
     <select id="selectIvrLibScriptcategoryList" parameterType="IvrLibScriptcategory" resultMap="IvrLibScriptcategoryResult">
         <include refid="selectIvrLibScriptcategoryVo"/>
-        <where>
+        where 1=1
             <if test="categoryname != null  and categoryname != ''"> and categoryname like concat('%', #{categoryname}, '%')</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>
-        </where>
     </select>
 
     <select id="selectIvrLibScriptcategoryByCategoryid" parameterType="Long" resultMap="IvrLibScriptcategoryResult">
diff --git a/smartor/src/main/resources/mapper/smartor/IvrLibScriptmodelMapper.xml b/smartor/src/main/resources/mapper/smartor/IvrLibScriptmodelMapper.xml
index 3e8809f..803fa5b 100644
--- a/smartor/src/main/resources/mapper/smartor/IvrLibScriptmodelMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/IvrLibScriptmodelMapper.xml
@@ -34,7 +34,7 @@
 
     <select id="selectIvrLibScriptmodelList" parameterType="IvrLibScriptmodel" resultMap="IvrLibScriptmodelResult">
         <include refid="selectIvrLibScriptmodelVo"/>
-        <where>
+        where 1=1
             <if test="orgid != null  and orgid != ''"> and orgid = #{orgid}</if>
             <if test="scriptid != null "> and scriptid = #{scriptid}</if>
             <if test="speaktype != null "> and speaktype = #{speaktype}</if>
@@ -49,7 +49,6 @@
             <if test="isupload != null "> and isupload = #{isupload}</if>
             <if test="uploadTime != null "> and upload_time = #{uploadTime}</if>
             <if test="speakvariable != null  and speakvariable != ''"> and speakvariable = #{speakvariable}</if>
-        </where>
     </select>
 
     <select id="selectIvrLibScriptmodelByModelid" parameterType="Long" resultMap="IvrLibScriptmodelResult">
diff --git a/smartor/src/main/resources/mapper/smartor/IvrLibaExtemplateCategoryMapper.xml b/smartor/src/main/resources/mapper/smartor/IvrLibaExtemplateCategoryMapper.xml
index e9c3c1e..0175e23 100644
--- a/smartor/src/main/resources/mapper/smartor/IvrLibaExtemplateCategoryMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/IvrLibaExtemplateCategoryMapper.xml
@@ -40,7 +40,7 @@
     <select id="selectIvrLibaExtemplateCategoryList" parameterType="com.smartor.domain.IvrLibaExtemplateCategory"
             resultMap="IvrLibaExtemplateCategoryResult">
         <include refid="selectIvrLibaExtemplateCategoryVo"/>
-        <where>
+        where 1=1
             <if test="categoryname != null  and categoryname != ''">and categoryname like concat('%', #{categoryname},
                 '%')
             </if>
@@ -51,7 +51,6 @@
             <if test="guid != null  and guid != ''">and guid = #{guid}</if>
             <if test="seqno != null ">and seqno = #{seqno}</if>
             and del_flag = 0
-        </where>
         order by seqno asc
     </select>
 
diff --git a/smartor/src/main/resources/mapper/smartor/IvrLibaExtemplateMapper.xml b/smartor/src/main/resources/mapper/smartor/IvrLibaExtemplateMapper.xml
index 711ac83..a0fa92f 100644
--- a/smartor/src/main/resources/mapper/smartor/IvrLibaExtemplateMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/IvrLibaExtemplateMapper.xml
@@ -33,8 +33,8 @@
     <select id="selectIvrLibaExtemplateList" parameterType="com.smartor.domain.IvrLibaExtemplate"
             resultMap="IvrLibaExtemplateResult">
         <include refid="selectIvrLibaExtemplateVo"/>
-        <where>
-            del_flag=0
+        where 1=1
+            and del_flag = 0
             <if test="extName != null  and extName != ''">and extName like concat('%', #{extName}, '%')</if>
             <if test="language != null  and language != ''">and language = #{language}</if>
             <if test="note != null  and note != ''">and note = #{note}</if>
@@ -46,7 +46,6 @@
             <if test="orgid != null  and orgid != ''">and orgid = #{orgid}</if>
             <if test="pid != null ">and pid = #{pid}</if>
             <if test="guid != null  and guid != ''">and guid = #{guid}</if>
-        </where>
     </select>
 
     <select id="selectIvrLibaExtemplateByID" parameterType="String" resultMap="IvrLibaExtemplateResult">
diff --git a/smartor/src/main/resources/mapper/smartor/IvrLibaExtemplatescriptMapper.xml b/smartor/src/main/resources/mapper/smartor/IvrLibaExtemplatescriptMapper.xml
index ad8ca58..bb5f1b2 100644
--- a/smartor/src/main/resources/mapper/smartor/IvrLibaExtemplatescriptMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/IvrLibaExtemplatescriptMapper.xml
@@ -56,7 +56,7 @@
     <select id="selectIvrLibaExtemplatescriptList" parameterType="com.smartor.domain.IvrLibaExtemplatescript"
             resultMap="IvrLibaExtemplatescriptResult">
         <include refid="selectIvrLibaExtemplatescriptVo"/>
-        <where>
+        where 1=1
             <if test="extID != null">and extID = #{extID}</if>
             <if test="switchID != null ">and switchID = #{switchID}</if>
             <if test="switchText != null  and switchText != ''">and switchText = #{switchText}</if>
@@ -70,21 +70,19 @@
             <if test="pid != null ">and pid = #{pid}</if>
             <if test="guid != null  and guid != ''">and guid = #{guid}</if>
             <if test="isEnd != null">and is_end = #{isEnd}</if>
-        </where>
     </select>
 
     <select id="queryIvrLibaExtemplatescriptList" parameterType="com.smartor.domain.IvrLibaExtemplatescript"
             resultMap="IvrLibaExtemplatescriptResult">
         <include refid="selectIvrLibaExtemplatescriptVo"/>
-        <where>
-            del_flag = 0
+        where 1=1
+            and del_flag = 0
             <if test="IDs != null">
                 and extID in
                 <foreach collection="IDs" item="item" open="(" separator="," close=")">
                     #{item}
                 </foreach>
             </if>
-        </where>
     </select>
 
     <select id="selectIvrLibaExtemplatescriptByID" parameterType="String" resultMap="IvrLibaExtemplatescriptResult">
diff --git a/smartor/src/main/resources/mapper/smartor/IvrLibaScriptAssortMapper.xml b/smartor/src/main/resources/mapper/smartor/IvrLibaScriptAssortMapper.xml
index 899f400..1cf778f 100644
--- a/smartor/src/main/resources/mapper/smartor/IvrLibaScriptAssortMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/IvrLibaScriptAssortMapper.xml
@@ -24,13 +24,13 @@
     <select id="selectIvrLibaScriptAssortList" parameterType="com.smartor.domain.IvrLibaScriptAssort"
             resultMap="IvrLibaScriptAssortResult">
         <include refid="selectIvrLibaScriptAssortVo"/>
-        <where>
+        where 1=1
             <if test="indexAssortName != null  and indexAssortName != ''">and index_assort_name like concat('%',
                 #{indexAssortName}, '%')
             </if>
             <if test="pid != null ">and pid = #{pid}</if>
+            <if test="orgid != null  and orgid != ''">and orgid = #{orgid}</if>
             and del_flag=0
-        </where>
         order by seqno asc
     </select>
 
diff --git a/smartor/src/main/resources/mapper/smartor/IvrLibaScriptMapper.xml b/smartor/src/main/resources/mapper/smartor/IvrLibaScriptMapper.xml
index abf54a3..ac239ca 100644
--- a/smartor/src/main/resources/mapper/smartor/IvrLibaScriptMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/IvrLibaScriptMapper.xml
@@ -90,8 +90,8 @@
     <select id="selectIvrLibaScriptList" parameterType="com.smartor.domain.IvrLibaScript"
             resultMap="IvrLibaScriptResult">
         <include refid="selectIvrLibaScriptVo"/>
-        <where>
-            del_flag=0
+        where 1=1
+            and del_flag = 0
             <if test="id != null ">and id = #{id}</if>
             <if test="deptIds != null  and deptIds != ''">and deptIds = #{deptIds}</if>
             <if test="deptNames != null  and deptNames != ''">and deptNames like concat('%', #{deptNames}, '%')</if>
@@ -133,7 +133,6 @@
             <if test="pid != null ">and pid = #{pid}</if>
             <if test="guid != null  and guid != ''">and guid = #{guid}</if>
             <if test="otherdata != null  and otherdata != ''">and otherdata = #{otherdata}</if>
-        </where>
     </select>
 
     <select id="selectIvrLibaScriptByQuestionid" parameterType="String" resultMap="IvrLibaScriptResult">
diff --git a/smartor/src/main/resources/mapper/smartor/IvrLibaScriptTagMapper.xml b/smartor/src/main/resources/mapper/smartor/IvrLibaScriptTagMapper.xml
index b2bc49e..c2c9a21 100644
--- a/smartor/src/main/resources/mapper/smartor/IvrLibaScriptTagMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/IvrLibaScriptTagMapper.xml
@@ -46,7 +46,7 @@
     <select id="selectIvrLibaScriptTagList" parameterType="com.smartor.domain.IvrLibaScriptTag"
             resultMap="IvrLibaScriptTagResult">
         <include refid="selectIvrLibaScriptTagVo"/>
-        <where>
+        where 1=1
             <if test="tagcategoryid != null ">and tagcategoryid = #{tagcategoryid}</if>
             <if test="scriptid != null ">and scriptid = #{scriptid}</if>
             <if test="tagid != null ">and tagid = #{tagid}</if>
@@ -56,7 +56,6 @@
             <if test="targetid != null ">and targetid = #{targetid}</if>
             <if test="pid != null ">and pid = #{pid}</if>
             <if test="guid != null  and guid != ''">and guid = #{guid}</if>
-        </where>
     </select>
 
     <select id="selectIvrLibaScriptTagById" parameterType="Long" resultMap="IvrLibaScriptTagResult">
diff --git a/smartor/src/main/resources/mapper/smartor/IvrLibaScriptTargetMapper.xml b/smartor/src/main/resources/mapper/smartor/IvrLibaScriptTargetMapper.xml
index 62e59ce..5ec2ebf 100644
--- a/smartor/src/main/resources/mapper/smartor/IvrLibaScriptTargetMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/IvrLibaScriptTargetMapper.xml
@@ -70,7 +70,7 @@
     <select id="selectIvrLibaScriptTargetList" parameterType="com.smartor.domain.IvrLibaScriptTarget"
             resultMap="IvrLibaScriptTargetResult">
         <include refid="selectIvrLibaScriptTargetVo"/>
-        <where>
+        where 1=1
             <if test="scriptid != null ">and scriptid = #{scriptid}</if>
             <if test="targetID != null ">and targetID = #{targetID}</if>
             <if test="targetType != null  and targetType != ''">and targetType = #{targetType}</if>
@@ -95,7 +95,6 @@
             <if test="warnup != null ">and warnup = #{warnup}</if>
             <if test="warndown != null">and warndown = #{warndown}</if>
             <if test="picturePath != null  and picturePath != ''">and picture_path = #{picturePath}</if>
-        </where>
     </select>
 
     <select id="selectIvrLibaScriptTargetByQuestionTargetID" parameterType="String"
diff --git a/smartor/src/main/resources/mapper/smartor/IvrLibaScriptTargetoptionMapper.xml b/smartor/src/main/resources/mapper/smartor/IvrLibaScriptTargetoptionMapper.xml
index ba14879..7878f0a 100644
--- a/smartor/src/main/resources/mapper/smartor/IvrLibaScriptTargetoptionMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/IvrLibaScriptTargetoptionMapper.xml
@@ -62,8 +62,8 @@
     <select id="selectIvrLibaScriptTargetoptionList" parameterType="com.smartor.domain.IvrLibaScriptTargetoption"
             resultMap="IvrLibaScriptTargetoptionResult">
         <include refid="selectIvrLibaScriptTargetoptionVo"/>
-        <where>
-            del_flag=0
+        where 1=1
+            and del_flag = 0
             <if test="targetid != null  and targetid != ''">and targetid = #{targetid}</if>
             <if test="targetname != null  and targetname != ''">and targetname = #{targetname}</if>
             <if test="scriptid != null ">and scriptid = #{scriptid}</if>
@@ -92,7 +92,6 @@
             <if test="appendflag != null">and appendflag = #{appendflag}</if>
             <if test="appenddesc != null">and appenddesc = #{appenddesc}</if>
             <if test="picturePath != null">and picture_path = #{picturePath}</if>
-        </where>
     </select>
 
     <select id="selectIvrLibaScriptTargetoptionByTargetoptionid" parameterType="String"
diff --git a/smartor/src/main/resources/mapper/smartor/IvrLibaTargetAssortMapper.xml b/smartor/src/main/resources/mapper/smartor/IvrLibaTargetAssortMapper.xml
index 848ef8a..2c9427f 100644
--- a/smartor/src/main/resources/mapper/smartor/IvrLibaTargetAssortMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/IvrLibaTargetAssortMapper.xml
@@ -24,13 +24,13 @@
     <select id="selectIvrLibaTargetAssortList" parameterType="com.smartor.domain.IvrLibaTargetAssort"
             resultMap="IvrLibaTargetAssortResult">
         <include refid="selectIvrLibaTargetAssortVo"/>
-        <where>
+        where 1=1
             <if test="indexAssortName != null  and indexAssortName != ''">and index_assort_name like concat('%',
                 #{indexAssortName}, '%')
             </if>
             <if test="pid != null ">and pid = #{pid}</if>
+            <if test="orgid != null  and orgid != ''">and orgid = #{orgid}</if>
             and del_flag=0
-        </where>
         order by seqno asc
     </select>
 
diff --git a/smartor/src/main/resources/mapper/smartor/IvrLibaTargetMapper.xml b/smartor/src/main/resources/mapper/smartor/IvrLibaTargetMapper.xml
index bf05b21..b44db52 100644
--- a/smartor/src/main/resources/mapper/smartor/IvrLibaTargetMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/IvrLibaTargetMapper.xml
@@ -107,8 +107,8 @@
     <select id="selectIvrLibaTargetList" parameterType="com.smartor.domain.IvrLibaTarget"
             resultMap="IvrLibaTargetResult">
         <include refid="selectIvrLibaTargetVo"/>
-        <where>
-            del_flag =0
+        where 1=1
+            and del_flag =0
             <if test="id != null ">and id = #{id}</if>
             <if test="groupid != null  and groupid != ''">and groupid = #{groupid}</if>
             <if test="targettype != null  and targettype != ''">and targettype = #{targettype}</if>
@@ -134,7 +134,6 @@
             <if test="parameter != null and parameter != ''">and parameter = #{parameter}</if>
             <if test="optionDesc != null and optionDesc != ''">and option_desc = #{optionDesc}</if>
 
-        </where>
         order by update_time desc
     </select>
 
@@ -170,8 +169,8 @@
         from ivr_liba_target a
         LEFT JOIN ivr_liba_targetoption b
         on a.id = b.targetid
-        <where>
-            a.del_flag != 1 and b.del_flag != 1
+        where 1=1
+            and a.del_flag != 1 and b.del_flag != 1
             <if test="groupid != null  and groupid != ''">and a.groupid = #{groupid}</if>
             <if test="targettype != null  and targettype != ''">and a.targettype = #{targettype}</if>
             <if test="targetname != null  and targetname != ''">and a.targetname like concat('%', #{targetname}, '%')
@@ -195,7 +194,6 @@
             <if test="parameter != null and parameter != ''">a.parameter = #{parameter}</if>
             <if test="optionDesc != null and optionDesc != ''">a.option_desc = #{optionDesc}</if>
 
-        </where>
         ORDER BY a.targetID
     </select>
 
diff --git a/smartor/src/main/resources/mapper/smartor/IvrLibaTargetTagMapper.xml b/smartor/src/main/resources/mapper/smartor/IvrLibaTargetTagMapper.xml
index 4333d15..1b31d5f 100644
--- a/smartor/src/main/resources/mapper/smartor/IvrLibaTargetTagMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/IvrLibaTargetTagMapper.xml
@@ -44,8 +44,8 @@
     <select id="selectIvrLibaTargetTagList" parameterType="com.smartor.domain.IvrLibaTargetTag"
             resultMap="IvrLibaTargetTagResult">
         <include refid="selectIvrLibaTargetTagVo"/>
-        <where>
-            del_flag=0
+        where 1=1
+            and del_flag = 0
             <if test="tagcategoryid != null ">and tagcategoryid = #{tagcategoryid}</if>
             <if test="tagid != null ">and tagid = #{tagid}</if>
             <if test="orgid != null  and orgid != ''">and orgid = #{orgid}</if>
@@ -55,7 +55,6 @@
             <if test="pid != null ">and pid = #{pid}</if>
             <if test="tagname != null ">and tagname = #{tagname}</if>
             <if test="guid != null  and guid != ''">and guid = #{guid}</if>
-        </where>
     </select>
 
     <select id="selectIvrLibaTargetTagById" parameterType="Long" resultMap="IvrLibaTargetTagResult">
diff --git a/smartor/src/main/resources/mapper/smartor/IvrLibaTargetoptionMapper.xml b/smartor/src/main/resources/mapper/smartor/IvrLibaTargetoptionMapper.xml
index 91884b1..21f2362 100644
--- a/smartor/src/main/resources/mapper/smartor/IvrLibaTargetoptionMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/IvrLibaTargetoptionMapper.xml
@@ -61,8 +61,8 @@
     <select id="selectIvrLibaTargetoptionList" parameterType="com.smartor.domain.IvrLibaTargetoption"
             resultMap="IvrLibaTargetoptionResult">
         <include refid="selectIvrLibaTargetoptionVo"/>
-        <where>
-            del_flag != 1
+        where 1=1
+            and del_flag != 1
             <if test="targetid != null ">and targetid = #{targetid}</if>
             <if test="targettype != null  and targettype != ''">and targettype = #{targettype}</if>
             <if test="categoryName != null  and categoryName != ''">and categoryName like concat('%', #{categoryName},
@@ -90,7 +90,6 @@
             <if test="appenddesc != null">and appenddesc = #{appenddesc}</if>
             <if test="picturePath != null">and picture_path = #{picturePath}</if>
             <if test="isEnd != null ">and is_end = #{isEnd}</if>
-        </where>
         order by guid asc
     </select>
 
diff --git a/smartor/src/main/resources/mapper/smartor/IvrLibaTemplateAssortMapper.xml b/smartor/src/main/resources/mapper/smartor/IvrLibaTemplateAssortMapper.xml
index 288b66a..7483a94 100644
--- a/smartor/src/main/resources/mapper/smartor/IvrLibaTemplateAssortMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/IvrLibaTemplateAssortMapper.xml
@@ -24,13 +24,13 @@
     <select id="selectIvrLibaTemplateAssortList" parameterType="com.smartor.domain.IvrLibaTemplateAssort"
             resultMap="IvrLibaTemplateAssortResult">
         <include refid="selectIvrLibaTemplateAssortVo"/>
-        <where>
-            del_flag=0
+        where 1=1
+            and del_flag = 0
             <if test="indexAssortName != null  and indexAssortName != ''">and index_assort_name like concat('%',
                 #{indexAssortName}, '%')
             </if>
             <if test="pid != null ">and pid = #{pid}</if>
-        </where>
+            <if test="orgid != null  and orgid != ''">and orgid = #{orgid}</if>
         order by seqno asc
     </select>
 
diff --git a/smartor/src/main/resources/mapper/smartor/IvrLibaTemplateMapper.xml b/smartor/src/main/resources/mapper/smartor/IvrLibaTemplateMapper.xml
index ed7b034..2cfaf4d 100644
--- a/smartor/src/main/resources/mapper/smartor/IvrLibaTemplateMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/IvrLibaTemplateMapper.xml
@@ -71,8 +71,8 @@
     <select id="selectIvrLibaTemplateList" parameterType="com.smartor.domain.IvrLibaTemplate"
             resultMap="IvrLibaTemplateResult">
         <include refid="selectIvrLibaTemplateVo"/>
-        <where>
-            del_flag=0
+        where 1=1
+            and del_flag = 0
             <if test="templateName != null  and templateName != ''">and templateName like concat('%', #{templateName},
                 '%')
             </if>
@@ -112,7 +112,6 @@
             <if test="noVoiceNum != null and noVoiceNum > 0">and no_voice_num = #{noVoiceNum}</if>
             <if test="silencetime != null">and silencetime = #{silencetime}</if>
             <if test="deptCode != null">and dept_code = #{deptCode}</if>
-        </where>
     </select>
 
     <select id="selectIvrLibaTemplateByID" parameterType="Long" resultMap="IvrLibaTemplateResult">
diff --git a/smartor/src/main/resources/mapper/smartor/IvrLibaTemplateScriptMapper.xml b/smartor/src/main/resources/mapper/smartor/IvrLibaTemplateScriptMapper.xml
index 31351c6..b7163f5 100644
--- a/smartor/src/main/resources/mapper/smartor/IvrLibaTemplateScriptMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/IvrLibaTemplateScriptMapper.xml
@@ -101,8 +101,8 @@
     <select id="selectIvrLibaTemplateScriptList" parameterType="com.smartor.domain.IvrLibaTemplateScript"
             resultMap="IvrLibaTemplateScriptResult">
         <include refid="selectIvrLibaTemplateScriptVo"/>
-        <where>
-            del_flag=0
+        where 1=1
+            and del_flag = 0
             <if test="scriptno != null ">and scriptno = #{scriptno}</if>
             <if test="assortid != null ">and assortid = #{assortid}</if>
             <if test="groupName != null ">and group_name = #{groupName}</if>
@@ -145,7 +145,6 @@
             <if test="scriptType != null">and script_type = #{scriptType}</if>
             <if test="sort != null">and sort = #{sort}</if>
             <if test="score != null">and score = #{score}</if>
-        </where>
     </select>
 
     <select id="selectIvrLibaTemplateScriptByID" parameterType="Long" resultMap="IvrLibaTemplateScriptResult">
diff --git a/smartor/src/main/resources/mapper/smartor/IvrLibaTemplateTagMapper.xml b/smartor/src/main/resources/mapper/smartor/IvrLibaTemplateTagMapper.xml
index 761185d..9d4b0cb 100644
--- a/smartor/src/main/resources/mapper/smartor/IvrLibaTemplateTagMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/IvrLibaTemplateTagMapper.xml
@@ -46,8 +46,8 @@
     <select id="selectIvrLibaTemplateTagList" parameterType="com.smartor.domain.IvrLibaTemplateTag"
             resultMap="IvrLibaTemplateTagResult">
         <include refid="selectIvrLibaTemplateTagVo"/>
-        <where>
-            del_flag=0
+        where 1=1
+            and del_flag = 0
             <if test="tagcategoryid != null ">and tagcategoryid = #{tagcategoryid}</if>
             <if test="templateid != null ">and templateid = #{templateid}</if>
             <if test="tagid != null ">and tagid = #{tagid}</if>
@@ -57,7 +57,6 @@
             <if test="targetid != null ">and targetid = #{targetid}</if>
             <if test="pid != null ">and pid = #{pid}</if>
             <if test="guid != null  and guid != ''">and guid = #{guid}</if>
-        </where>
     </select>
 
     <select id="selectIvrLibaTemplateTagById" parameterType="Long" resultMap="IvrLibaTemplateTagResult">
diff --git a/smartor/src/main/resources/mapper/smartor/IvrLibaTemplateTargetoptionMapper.xml b/smartor/src/main/resources/mapper/smartor/IvrLibaTemplateTargetoptionMapper.xml
index 48c6dee..38d04c6 100644
--- a/smartor/src/main/resources/mapper/smartor/IvrLibaTemplateTargetoptionMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/IvrLibaTemplateTargetoptionMapper.xml
@@ -72,8 +72,8 @@
     <select id="selectIvrLibaTemplateTargetoptionList" parameterType="com.smartor.domain.IvrLibaTemplateTargetoption"
             resultMap="IvrLibaTemplateTargetoptionResult">
         <include refid="selectIvrLibaTemplateTargetoptionVo"/>
-        <where>
-            del_flag=0
+        where 1=1
+            and del_flag = 0
             <if test="targetid != null ">and targetid = #{targetid}</if>
             <if test="isEnd != null ">and is_end = #{isEnd}</if>
             <if test="score != null ">and score = #{score}</if>
@@ -104,7 +104,6 @@
             <if test="optionNo != null">and option_no = #{optionNo}</if>
             <if test="sendTaskid != null">and send_taskid= #{sendTaskid}</if>
             <if test="sendTaskname != null">and send_taskname = #{sendTaskname}</if>
-        </where>
     </select>
 
     <select id="selectIvrLibaTemplateTargetoptionById" parameterType="Long"
diff --git a/smartor/src/main/resources/mapper/smartor/IvrSceneExecuteconfigMapper.xml b/smartor/src/main/resources/mapper/smartor/IvrSceneExecuteconfigMapper.xml
index 5b25a3e..d1632d6 100644
--- a/smartor/src/main/resources/mapper/smartor/IvrSceneExecuteconfigMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/IvrSceneExecuteconfigMapper.xml
@@ -33,7 +33,7 @@
 
     <select id="selectIvrSceneExecuteconfigList" parameterType="IvrSceneExecuteconfig" resultMap="IvrSceneExecuteconfigResult">
         <include refid="selectIvrSceneExecuteconfigVo"/>
-        <where>
+        where 1=1
             <if test="orgid != null  and orgid != ''"> and orgid = #{orgid}</if>
             <if test="sourcetype != null "> and sourcetype = #{sourcetype}</if>
             <if test="globalid != null "> and globalid = #{globalid}</if>
@@ -47,7 +47,6 @@
             <if test="executeconditionscode != null  and executeconditionscode != ''"> and executeconditionscode = #{executeconditionscode}</if>
             <if test="executeresultcode != null  and executeresultcode != ''"> and executeresultcode = #{executeresultcode}</if>
             <if test="flownodeid != null "> and flownodeid = #{flownodeid}</if>
-        </where>
     </select>
 
     <select id="selectIvrSceneExecuteconfigByScenecfgid" parameterType="Long" resultMap="IvrSceneExecuteconfigResult">
diff --git a/smartor/src/main/resources/mapper/smartor/IvrSceneFlowMapper.xml b/smartor/src/main/resources/mapper/smartor/IvrSceneFlowMapper.xml
index a71853f..afcfb7b 100644
--- a/smartor/src/main/resources/mapper/smartor/IvrSceneFlowMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/IvrSceneFlowMapper.xml
@@ -33,7 +33,7 @@
 
     <select id="selectIvrSceneFlowList" parameterType="IvrSceneFlow" resultMap="IvrSceneFlowResult">
         <include refid="selectIvrSceneFlowVo"/>
-        <where>
+        where 1=1
             <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>
@@ -47,7 +47,6 @@
             <if test="sort != null "> and sort = #{sort}</if>
             <if test="startnode != null "> and startnode = #{startnode}</if>
             <if test="oldid != null "> and oldid = #{oldid}</if>
-        </where>
     </select>
 
     <select id="selectIvrSceneFlowByFlowid" parameterType="Long" resultMap="IvrSceneFlowResult">
diff --git a/smartor/src/main/resources/mapper/smartor/IvrSceneFlownodeMapper.xml b/smartor/src/main/resources/mapper/smartor/IvrSceneFlownodeMapper.xml
index 0299899..ce96330 100644
--- a/smartor/src/main/resources/mapper/smartor/IvrSceneFlownodeMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/IvrSceneFlownodeMapper.xml
@@ -37,7 +37,7 @@
 
     <select id="selectIvrSceneFlownodeList" parameterType="IvrSceneFlownode" resultMap="IvrSceneFlownodeResult">
         <include refid="selectIvrSceneFlownodeVo"/>
-        <where>
+        where 1=1
             <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>
@@ -55,7 +55,6 @@
             <if test="flowcode != null  and flowcode != ''"> and flowcode = #{flowcode}</if>
             <if test="targetid != null "> and targetid = #{targetid}</if>
             <if test="oldid != null "> and oldid = #{oldid}</if>
-        </where>
     </select>
 
     <select id="selectIvrSceneFlownodeByFlownodeid" parameterType="Long" resultMap="IvrSceneFlownodeResult">
diff --git a/smartor/src/main/resources/mapper/smartor/IvrSceneFlownodebranchMapper.xml b/smartor/src/main/resources/mapper/smartor/IvrSceneFlownodebranchMapper.xml
index 7dcdb02..fe7e73a 100644
--- a/smartor/src/main/resources/mapper/smartor/IvrSceneFlownodebranchMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/IvrSceneFlownodebranchMapper.xml
@@ -32,7 +32,7 @@
 
     <select id="selectIvrSceneFlownodebranchList" parameterType="IvrSceneFlownodebranch" resultMap="IvrSceneFlownodebranchResult">
         <include refid="selectIvrSceneFlownodebranchVo"/>
-        <where>
+        where 1=1
             <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>
@@ -45,7 +45,6 @@
             <if test="nodetype != null "> and nodetype = #{nodetype}</if>
             <if test="targetid != null "> and targetid = #{targetid}</if>
             <if test="oldid != null "> and oldid = #{oldid}</if>
-        </where>
     </select>
 
     <select id="selectIvrSceneFlownodebranchByBranchid" parameterType="Long" resultMap="IvrSceneFlownodebranchResult">
diff --git a/smartor/src/main/resources/mapper/smartor/IvrSceneGlobalconfigMapper.xml b/smartor/src/main/resources/mapper/smartor/IvrSceneGlobalconfigMapper.xml
index d44f07b..a99b2c4 100644
--- a/smartor/src/main/resources/mapper/smartor/IvrSceneGlobalconfigMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/IvrSceneGlobalconfigMapper.xml
@@ -31,7 +31,7 @@
 
     <select id="selectIvrSceneGlobalconfigList" parameterType="IvrSceneGlobalconfig" resultMap="IvrSceneGlobalconfigResult">
         <include refid="selectIvrSceneGlobalconfigVo"/>
-        <where>
+        where 1=1
             <if test="sceneid != null "> and sceneid = #{sceneid}</if>
             <if test="configname != null  and configname != ''"> and configname like concat('%', #{configname}, '%')</if>
             <if test="description != null  and description != ''"> and description = #{description}</if>
@@ -43,7 +43,6 @@
             <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>
-        </where>
     </select>
 
     <select id="selectIvrSceneGlobalconfigByGblconfigid" parameterType="Long" resultMap="IvrSceneGlobalconfigResult">
diff --git a/smartor/src/main/resources/mapper/smartor/IvrSceneIntentMapper.xml b/smartor/src/main/resources/mapper/smartor/IvrSceneIntentMapper.xml
index 13d6937..e3b5c1b 100644
--- a/smartor/src/main/resources/mapper/smartor/IvrSceneIntentMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/IvrSceneIntentMapper.xml
@@ -63,7 +63,7 @@
 
     <select id="selectIvrSceneIntentList" parameterType="IvrSceneIntent" resultMap="IvrSceneIntentResult">
         <include refid="selectIvrSceneIntentVo"/>
-        <where>
+        where 1=1
             <if test="orgid != null  and orgid != ''">and orgid = #{orgid}</if>
             <if test="sourcetype != null ">and sourcetype = #{sourcetype}</if>
             <if test="gbiconfigid != null ">and gbiconfigid = #{gbiconfigid}</if>
@@ -86,7 +86,6 @@
             <if test="grouporand != null ">and grouporand = #{grouporand}</if>
             <if test="isupload != null ">and isupload = #{isupload}</if>
             <if test="uploadTime != null ">and upload_time = #{uploadTime}</if>
-        </where>
     </select>
 
     <select id="selectIvrSceneIntentBySceneintentid" parameterType="Long" resultMap="IvrSceneIntentResult">
diff --git a/smartor/src/main/resources/mapper/smartor/IvrSceneMapper.xml b/smartor/src/main/resources/mapper/smartor/IvrSceneMapper.xml
index 87ff05c..0c4a421 100644
--- a/smartor/src/main/resources/mapper/smartor/IvrSceneMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/IvrSceneMapper.xml
@@ -36,7 +36,7 @@
 
     <select id="selectIvrSceneList" parameterType="IvrScene" resultMap="IvrSceneResult">
         <include refid="selectIvrSceneVo"/>
-        <where>
+        where 1=1
             <if test="categoryid != null  and categoryid != ''"> and categoryid = #{categoryid}</if>
             <if test="scenename != null  and scenename != ''"> and scenename like concat('%', #{scenename}, '%')</if>
             <if test="version != null  and version != ''"> and version = #{version}</if>
@@ -53,7 +53,6 @@
             <if test="uploadTime != null "> and upload_time = #{uploadTime}</if>
             <if test="releasenotes != null  and releasenotes != ''"> and releasenotes = #{releasenotes}</if>
             <if test="draftid != null "> and draftid = #{draftid}</if>
-        </where>
     </select>
 
     <select id="selectIvrSceneBySceneid" parameterType="Long" resultMap="IvrSceneResult">
diff --git a/smartor/src/main/resources/mapper/smartor/IvrSceneRecallMapper.xml b/smartor/src/main/resources/mapper/smartor/IvrSceneRecallMapper.xml
index 3ad7b9a..cdee34d 100644
--- a/smartor/src/main/resources/mapper/smartor/IvrSceneRecallMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/IvrSceneRecallMapper.xml
@@ -28,7 +28,7 @@
 
     <select id="selectIvrSceneRecallList" parameterType="IvrSceneRecall" resultMap="IvrSceneRecallResult">
         <include refid="selectIvrSceneRecallVo"/>
-        <where>
+        where 1=1
             <if test="orgid != null  and orgid != ''"> and orgid = #{orgid}</if>
             <if test="sceneid != null "> and sceneid = #{sceneid}</if>
             <if test="recalltype != null  and recalltype != ''"> and recalltype = #{recalltype}</if>
@@ -37,7 +37,6 @@
             <if test="recallunit != null "> and recallunit = #{recallunit}</if>
             <if test="isupload != null "> and isupload = #{isupload}</if>
             <if test="uploadTime != null "> and upload_time = #{uploadTime}</if>
-        </where>
     </select>
 
     <select id="selectIvrSceneRecallByRecallid" parameterType="Long" resultMap="IvrSceneRecallResult">
diff --git a/smartor/src/main/resources/mapper/smartor/IvrSceneScriptMapper.xml b/smartor/src/main/resources/mapper/smartor/IvrSceneScriptMapper.xml
index fd1a8f3..4934bf2 100644
--- a/smartor/src/main/resources/mapper/smartor/IvrSceneScriptMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/IvrSceneScriptMapper.xml
@@ -32,7 +32,7 @@
 
     <select id="selectIvrSceneScriptList" parameterType="IvrSceneScript" resultMap="IvrSceneScriptResult">
         <include refid="selectIvrSceneScriptVo"/>
-        <where>
+        where 1=1
             <if test="orgid != null  and orgid != ''"> and orgid = #{orgid}</if>
             <if test="sourcetype != null "> and sourcetype = #{sourcetype}</if>
             <if test="globalid != null "> and globalid = #{globalid}</if>
@@ -45,7 +45,6 @@
             <if test="speakname != null  and speakname != ''"> and speakname like concat('%', #{speakname}, '%')</if>
             <if test="isupload != null "> and isupload = #{isupload}</if>
             <if test="uploadTime != null "> and upload_time = #{uploadTime}</if>
-        </where>
     </select>
 
     <select id="selectIvrSceneScriptByScenescrid" parameterType="Long" resultMap="IvrSceneScriptResult">
diff --git a/smartor/src/main/resources/mapper/smartor/IvrSceneScriptmodelMapper.xml b/smartor/src/main/resources/mapper/smartor/IvrSceneScriptmodelMapper.xml
index 09f100c..79fd6ae 100644
--- a/smartor/src/main/resources/mapper/smartor/IvrSceneScriptmodelMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/IvrSceneScriptmodelMapper.xml
@@ -35,7 +35,7 @@
 
     <select id="selectIvrSceneScriptmodelList" parameterType="IvrSceneScriptmodel" resultMap="IvrSceneScriptmodelResult">
         <include refid="selectIvrSceneScriptmodelVo"/>
-        <where>
+        where 1=1
             <if test="orgid != null  and orgid != ''"> and orgid = #{orgid}</if>
             <if test="scenescrid != null "> and scenescrid = #{scenescrid}</if>
             <if test="speaktype != null "> and speaktype = #{speaktype}</if>
@@ -51,7 +51,6 @@
             <if test="uploadTime != null "> and upload_time = #{uploadTime}</if>
             <if test="speakvariable != null  and speakvariable != ''"> and speakvariable = #{speakvariable}</if>
             <if test="sceneid != null "> and sceneid = #{sceneid}</if>
-        </where>
     </select>
 
     <select id="selectIvrSceneScriptmodelByScenemodid" parameterType="Long" resultMap="IvrSceneScriptmodelResult">
diff --git a/smartor/src/main/resources/mapper/smartor/IvrScenecategoryMapper.xml b/smartor/src/main/resources/mapper/smartor/IvrScenecategoryMapper.xml
index 95ecb36..314fddc 100644
--- a/smartor/src/main/resources/mapper/smartor/IvrScenecategoryMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/IvrScenecategoryMapper.xml
@@ -24,12 +24,11 @@
 
     <select id="selectIvrScenecategoryList" parameterType="IvrScenecategory" resultMap="IvrScenecategoryResult">
         <include refid="selectIvrScenecategoryVo"/>
-        <where>
+        where 1=1
             <if test="categoryname != null  and categoryname != ''"> and categoryname like concat('%', #{categoryname}, '%')</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>
-        </where>
     </select>
 
     <select id="selectIvrScenecategoryByScenecatid" parameterType="Long" resultMap="IvrScenecategoryResult">
diff --git a/smartor/src/main/resources/mapper/smartor/IvrTaskTemplateMapper.xml b/smartor/src/main/resources/mapper/smartor/IvrTaskTemplateMapper.xml
index 554cc72..7873b2e 100644
--- a/smartor/src/main/resources/mapper/smartor/IvrTaskTemplateMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/IvrTaskTemplateMapper.xml
@@ -91,8 +91,8 @@
     <select id="selectIvrTaskTemplateList" parameterType="com.smartor.domain.IvrTaskTemplate"
             resultMap="IvrTaskTemplateResult">
         <include refid="selectIvrTaskTemplateVo"/>
-        <where>
-            del_flag = 0
+        where 1=1
+            and del_flag = 0
             <if test="taskid != null ">and taskid = #{taskid}</if>
             <if test="sendDay != null ">and send_day = #{sendDay}</if>
             <if test="id != null ">and id = #{id}</if>
@@ -150,7 +150,6 @@
             <if test="recallcount != null">and recallcount = #{prologrecallcountue}</if>
             <if test="deptCode != null">and dept_code = #{deptCode}</if>
             <if test="longTemp != null">and long_temp = #{longTemp}</if>
-        </where>
     </select>
 
     <select id="selectIvrTaskTemplateByID" parameterType="Long" resultMap="IvrTaskTemplateResult">
diff --git a/smartor/src/main/resources/mapper/smartor/IvrTaskTemplateScriptMapper.xml b/smartor/src/main/resources/mapper/smartor/IvrTaskTemplateScriptMapper.xml
index 7db4ec5..e55dd25 100644
--- a/smartor/src/main/resources/mapper/smartor/IvrTaskTemplateScriptMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/IvrTaskTemplateScriptMapper.xml
@@ -82,8 +82,8 @@
     <select id="selectIvrTaskTemplateScriptList" parameterType="com.smartor.domain.IvrTaskTemplateScript"
             resultMap="IvrTaskTemplateScriptResult">
         <include refid="selectIvrTaskTemplateScriptVo"/>
-        <where>
-            del_flag=0
+        where 1=1
+            and del_flag = 0
             <if test="taskid != null ">and taskid = #{taskid}</if>
             <if test="assortid != null ">and assortid = #{assortid}</if>
             <if test="score != null ">and score = #{score}</if>
@@ -125,7 +125,6 @@
             <if test="branchNextscriptno != null  and branchNextscriptno != ''">and branch_nextscriptno =
                 #{branchNextscriptno}
             </if>
-        </where>
     </select>
 
     <select id="selectIvrTaskTemplateScriptByID" parameterType="Long" resultMap="IvrTaskTemplateScriptResult">
diff --git a/smartor/src/main/resources/mapper/smartor/IvrTaskTemplateTargetoptionMapper.xml b/smartor/src/main/resources/mapper/smartor/IvrTaskTemplateTargetoptionMapper.xml
index 2dca21e..f89d0a0 100644
--- a/smartor/src/main/resources/mapper/smartor/IvrTaskTemplateTargetoptionMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/IvrTaskTemplateTargetoptionMapper.xml
@@ -71,7 +71,7 @@
     <select id="selectIvrTaskTemplateTargetoptionList" parameterType="com.smartor.domain.IvrTaskTemplateTargetoption"
             resultMap="IvrTaskTemplateTargetoptionResult">
         <include refid="selectIvrTaskTemplateTargetoptionVo"/>
-        <where>
+        where 1=1
             <if test="taskid != null ">and taskid = #{taskid}</if>
             <if test="isEnd != null ">and is_end = #{isEnd}</if>
             <if test="templateID != null ">and templateID = #{templateID}</if>
@@ -108,7 +108,6 @@
             <if test="score != null ">and score = #{score}</if>
             <if test="sendTaskid != null">and send_taskid= #{sendTaskid}</if>
             <if test="sendTaskname != null">and send_taskname = #{sendTaskname}</if>
-        </where>
     </select>
 
     <select id="selectIvrTaskTemplateTargetoptionById" parameterType="Long"
diff --git a/smartor/src/main/resources/mapper/smartor/IvrTaskVisitResultMapper.xml b/smartor/src/main/resources/mapper/smartor/IvrTaskVisitResultMapper.xml
index 5a727c0..f3c933d 100644
--- a/smartor/src/main/resources/mapper/smartor/IvrTaskVisitResultMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/IvrTaskVisitResultMapper.xml
@@ -60,7 +60,7 @@
     <select id="selectIvrTaskVisitResultList" parameterType="com.smartor.domain.IvrTaskVisitResult"
             resultMap="IvrTaskVisitResultResult">
         <include refid="selectIvrTaskVisitResultVo"/>
-        <where>
+        where 1=1
             <if test="sendname != null  and sendname != ''">and sendname like concat('%', #{sendname}, '%')</if>
             <if test="phone != null  and phone != ''">and phone = #{phone}</if>
             <if test="sex != null  and sex != ''">and sex = #{sex}</if>
@@ -79,7 +79,6 @@
             <if test="patientAnswer != null  and patientAnswer != ''">and patient_answer = #{patientAnswer}</if>
             <if test="optionResult != null  and optionResult != ''">and option_result = #{optionResult}</if>
             <if test="orgid != null  and orgid != ''">and orgid = #{orgid}</if>
-        </where>
     </select>
 
     <select id="selectIvrTaskVisitResultById" parameterType="Long" resultMap="IvrTaskVisitResultResult">
diff --git a/smartor/src/main/resources/mapper/smartor/IvrTaskcallrecordMapper.xml b/smartor/src/main/resources/mapper/smartor/IvrTaskcallrecordMapper.xml
index 498153d..da48e48 100644
--- a/smartor/src/main/resources/mapper/smartor/IvrTaskcallrecordMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/IvrTaskcallrecordMapper.xml
@@ -84,7 +84,7 @@
     <select id="selectIvrTaskcallrecordList" parameterType="com.smartor.domain.IvrTaskcallrecord"
             resultMap="IvrTaskcallrecordResult">
         <include refid="selectIvrTaskcallrecordVo"/>
-        <where>
+        where 1=1
             <if test="displayno != null  and displayno != ''">and displayno = #{displayno}</if>
             <if test="phone != null  and phone != ''">and phone = #{phone}</if>
             <if test="taskid != null  and taskid != ''">and taskid = #{taskid}</if>
@@ -113,7 +113,6 @@
             <if test="isupload != null ">and isupload = #{isupload}</if>
             <if test="uploadTime != null ">and upload_time = #{uploadTime}</if>
             <if test="orgid != null  and orgid != ''">and orgid = #{orgid}</if>
-        </where>
     </select>
 
     <select id="selectIvrTaskcallrecordByUuid" parameterType="String" resultMap="IvrTaskcallrecordResult">
diff --git a/smartor/src/main/resources/mapper/smartor/IvrTasksmsMapper.xml b/smartor/src/main/resources/mapper/smartor/IvrTasksmsMapper.xml
index a8681cf..42b3497 100644
--- a/smartor/src/main/resources/mapper/smartor/IvrTasksmsMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/IvrTasksmsMapper.xml
@@ -51,7 +51,7 @@
 
     <select id="selectIvrTasksmsList" parameterType="com.smartor.domain.IvrTasksms" resultMap="IvrTasksmsResult">
         <include refid="selectIvrTasksmsVo"/>
-        <where>
+        where 1=1
             <if test="taskid != null ">and taskid = #{taskid}</if>
             <if test="type != null ">and type = #{type}</if>
             <if test="smstemplateid != null ">and smstemplateid = #{smstemplateid}</if>
@@ -68,7 +68,6 @@
             <if test="isupload != null ">and isupload = #{isupload}</if>
             <if test="uploadTime != null ">and upload_time = #{uploadTime}</if>
             <if test="orgid != null  and orgid != ''">and orgid = #{orgid}</if>
-        </where>
     </select>
 
     <select id="selectIvrTasksmsById" parameterType="Long" resultMap="IvrTasksmsResult">
diff --git a/smartor/src/main/resources/mapper/smartor/MedicalHistoryMapper.xml b/smartor/src/main/resources/mapper/smartor/MedicalHistoryMapper.xml
index 2527ff8..ea077ce 100644
--- a/smartor/src/main/resources/mapper/smartor/MedicalHistoryMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/MedicalHistoryMapper.xml
@@ -28,7 +28,7 @@
 
     <select id="selectMedicalHistoryList" parameterType="com.smartor.domain.MedicalHistory" resultMap="MedicalHistoryResult">
         <include refid="selectMedicalHistoryVo"/>
-        <where>
+        where 1=1
             <if test="pastIllnesses != null  and pastIllnesses != ''"> and past_illnesses = #{pastIllnesses}</if>
             <if test="drugAllergy != null  and drugAllergy != ''"> and drug_allergy = #{drugAllergy}</if>
             <if test="familyHistory != null  and familyHistory != ''"> and family_history = #{familyHistory}</if>
@@ -42,7 +42,6 @@
             <if test="psychology != null  and psychology != ''"> and psychology = #{psychology}</if>
             <if test="pid != null "> and pid = #{pid}</if>
             <if test="orgid != null "> and orgid = #{orgid}</if>
-        </where>
     </select>
 
     <select id="selectMedicalHistoryById" parameterType="Long" resultMap="MedicalHistoryResult">
diff --git a/smartor/src/main/resources/mapper/smartor/MinioFileMapper.xml b/smartor/src/main/resources/mapper/smartor/MinioFileMapper.xml
index 3de25fe..e2224ad 100644
--- a/smartor/src/main/resources/mapper/smartor/MinioFileMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/MinioFileMapper.xml
@@ -41,7 +41,7 @@
 
     <select id="selectMinioFileList" parameterType="com.smartor.domain.MinioFile" resultMap="MinioFileResult">
         <include refid="selectMinioFileVo"/>
-        <where>
+        where 1=1
             <if test="originalFileName != null  and originalFileName != ''">and original_file_name like concat('%',
                 #{originalFileName}, '%')
             </if>
@@ -54,7 +54,6 @@
             <if test="mime != null  and mime != ''">and mime = #{mime}</if>
             <if test="fileUrl != null  and fileUrl != ''">and file_url = #{fileUrl}</if>
             <if test="isDelete != null ">and is_delete = #{isDelete}</if>
-        </where>
     </select>
 
     <select id="selectMinioFileById" parameterType="Long" resultMap="MinioFileResult">
diff --git a/smartor/src/main/resources/mapper/smartor/PatArchiveImportMapper.xml b/smartor/src/main/resources/mapper/smartor/PatArchiveImportMapper.xml
index a6155e6..e962013 100644
--- a/smartor/src/main/resources/mapper/smartor/PatArchiveImportMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/PatArchiveImportMapper.xml
@@ -54,8 +54,8 @@
     <select id="selectPatArchiveImportList" parameterType="com.smartor.domain.PatArchiveImport"
             resultMap="PatArchiveImportResult">
         <include refid="selectPatArchiveImportVo"/>
-        <where>
-            del_flag=0
+        where 1=1
+            and del_flag = 0
             <if test="patientno != null  and patientno != ''">
                 and patientno = #{patientno}
             </if>
@@ -89,7 +89,6 @@
             <if test="batchNo != null  and batchNo != ''">
                 and batch_no = #{batchNo}
             </if>
-        </where>
         ORDER BY create_time desc
     </select>
 
diff --git a/smartor/src/main/resources/mapper/smartor/PatArchiveMapper.xml b/smartor/src/main/resources/mapper/smartor/PatArchiveMapper.xml
index d10139b..cbfe8a3 100644
--- a/smartor/src/main/resources/mapper/smartor/PatArchiveMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/PatArchiveMapper.xml
@@ -180,8 +180,8 @@
 
     <select id="selectPatArchiveList" parameterType="com.smartor.domain.PatArchive" resultMap="PatArchiveResult">
         <include refid="selectPatArchiveVo"/>
-        <where>
-            del_flag=0
+        where 1=1
+            and del_flag = 0
             <if test="name != null  and name != ''">and name like concat('%', #{name}, '%')</if>
             <if test="idcardno != null  and idcardno != ''">and idcardno = #{idcardno}</if>
             <if test="sourcefrom != null ">and sourcefrom = #{sourcefrom}</if>
@@ -212,7 +212,6 @@
             <if test="filterDrname != null ">and filter_drname = #{filterDrname}</if>
             <if test="filterDrcode != null ">and filter_drcode = #{filterDrcode}</if>
             <if test="campusid != null ">and campusid = #{campusid}</if>
-        </where>
     </select>
 
 
@@ -250,9 +249,10 @@
         a.filter_drcode,
         a.case_person_age
         from pat_archive a,pat_archivetag b ,base_tag c
-        <where>
-            a.del_flag=0 and
-            a.id = b.patid and b.tagid = c.tagid
+        where 1=1
+            and a.del_flag = 0
+            and a.id = b.patid
+            and b.tagid = c.tagid
             <if test="filterDrname != null ">and filter_drname = #{filterDrname}</if>
             <if test="filterDrcode != null ">and filter_drcode = #{filterDrcode}</if>
             <if test="name != null  and name != ''">and a.name like concat('%', #{name}, '%')</if>
@@ -264,7 +264,6 @@
                     #{tagId}
                 </foreach>
             </if>
-        </where>
     </select>
 
     <select id="selectPatArchiveByPatid" parameterType="Long" resultMap="PatArchiveResult">
@@ -513,8 +512,8 @@
         FROM
         pat_archive a
         LEFT JOIN pat_archivetag b ON a.id = b.patid AND b.del_flag = 0
-        <where>
-            a.del_flag = 0
+        where 1=1
+            and a.del_flag = 0
             and a.orgid = #{orgid}
             <if test="name != null  and name != ''">and a.name like concat('%', #{name}, '%')</if>
             <if test="idcardno != null  and idcardno != ''">and a.idcardno = #{idcardno}</if>
@@ -528,7 +527,6 @@
                     #{tagId}
                 </foreach>
             </if>
-        </where>
         order by a.update_time desc
         <if test="pn != null  and ps != null">limit ${pn},${ps}</if>
 
@@ -596,8 +594,8 @@
         LEFT JOIN ( SELECT patid, GROUP_CONCAT( tagname ) AS tagname FROM pat_archivetag where del_flag=0 GROUP BY patid
         ) t ON t.patid =
         d.patid
-        <where>
-            d.del_flag != 1
+        where 1=1
+            and d.del_flag != 1
             AND a.del_flag != 1
             and d.orgid = #{orgid}
             <if test="name != null  and name != ''">and a.name like concat('%', #{name}, '%')</if>
@@ -672,7 +670,6 @@
             <if test="isFilter == true">
                 AND NOT exists ( SELECT 1 FROM pat_filterlist f where d.patid=f.patid)
             </if>
-        </where>
         -- order by a.update_time desc
         <if test="pageSize != null  and pageNum != null">limit ${pageSize} OFFSET ${pageNum}</if>
 
@@ -728,8 +725,8 @@
         LEFT JOIN ( SELECT patid, GROUP_CONCAT( tagname ) AS tagname FROM pat_archivetag where del_flag=0 GROUP BY patid
         ) t ON t.patid =
         d.patid
-        <where>
-            d.del_flag != 1
+        where 1=1
+            and d.del_flag != 1
             AND a.del_flag != 1
             and d.orgid = #{orgid}
             <if test="pid != null  and pid != ''">and a.id = #{pid}</if>
@@ -766,7 +763,6 @@
             <if test="isFilter == true">
                 AND NOT exists ( SELECT 1 FROM pat_filterlist f where d.patid=f.patid)
             </if>
-        </where>
         -- order by a.update_time desc
         <if test="pageSize != null  and pageNum != null">limit ${pageSize} OFFSET ${pageNum}</if>
     </select>
@@ -822,8 +818,8 @@
         LEFT JOIN ( SELECT patid, GROUP_CONCAT( tagname ) AS tagname FROM pat_archivetag where del_flag=0 GROUP BY patid
         ) t ON t.patid =
         d.patid
-        <where>
-            d.del_flag != 1
+        where 1=1
+            and d.del_flag != 1
             AND a.del_flag != 1
             and d.orgid = #{orgid}
             <if test="pid != null  and pid != ''">and a.id = #{pid}</if>
@@ -861,7 +857,6 @@
             <if test="isFilter == true">
                 AND NOT exists ( SELECT 1 FROM pat_filterlist f where d.patid=f.patid)
             </if>
-        </where>
         -- order by a.update_time desc
         <if test="pageSize != null  and pageNum != null">limit ${pageSize} OFFSET ${pageNum}</if>
     </select>
@@ -930,8 +925,8 @@
         LEFT JOIN ( SELECT patid, GROUP_CONCAT( tagname ) AS tagname FROM pat_archivetag where del_flag=0 GROUP BY patid
         ) t ON t.patid =
         d.patid
-        <where>
-            d.del_flag != 1
+        where 1=1
+            and d.del_flag != 1
             AND a.del_flag != 1
             and d.orgid = #{orgid}
             <if test="name != null  and name != ''">and a.name like concat('%', #{name}, '%')</if>
@@ -1010,7 +1005,6 @@
             <if test="isFilter == true">
                 AND NOT exists ( SELECT 1 FROM pat_filterlist f where d.patid=f.patid)
             </if>
-        </where>
         <if test="pageSize != null  and pageNum != null">limit ${pageSize} OFFSET ${pageNum}</if>
         ) as tmp
     </select>
@@ -1066,8 +1060,8 @@
         LEFT JOIN ( SELECT patid, GROUP_CONCAT( tagname ) AS tagname FROM pat_archivetag where del_flag=0 GROUP BY patid
         ) t ON t.patid =
         d.patid
-        <where>
-            d.del_flag != 1
+        where 1=1
+            and d.del_flag != 1
             AND a.del_flag != 1
             and d.orgid = #{orgid}
             <if test="pid != null  and pid != ''">and a.id = #{pid}</if>
@@ -1107,7 +1101,6 @@
             <if test="isFilter == true">
                 AND NOT exists ( SELECT 1 FROM pat_filterlist f where d.patid=f.patid)
             </if>
-        </where>
         <if test="pageSize != null  and pageNum != null">limit ${pageSize} OFFSET ${pageNum}</if>
     </select>
 
@@ -1162,8 +1155,8 @@
         LEFT JOIN ( SELECT patid, GROUP_CONCAT( tagname ) AS tagname FROM pat_archivetag where del_flag=0 GROUP BY patid
         ) t ON t.patid =
         d.patid
-        <where>
-            d.del_flag != 1
+        where 1=1
+            and d.del_flag != 1
             AND a.del_flag != 1
             and d.orgid = #{orgid}
             <if test="pid != null  and pid != ''">and a.id = #{pid}</if>
@@ -1201,7 +1194,6 @@
             <if test="isFilter == true">
                 AND NOT exists ( SELECT 1 FROM pat_filterlist f where d.patid=f.patid)
             </if>
-        </where>
         -- order by a.update_time desc
         <if test="pageSize != null  and pageNum != null">limit ${pageSize} OFFSET ${pageNum}</if>
     </select>
diff --git a/smartor/src/main/resources/mapper/smartor/PatArchiveOutMapper.xml b/smartor/src/main/resources/mapper/smartor/PatArchiveOutMapper.xml
index ea37b26..45e43b7 100644
--- a/smartor/src/main/resources/mapper/smartor/PatArchiveOutMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/PatArchiveOutMapper.xml
@@ -76,7 +76,7 @@
     <select id="selectPatArchiveOutList" parameterType="com.smartor.domain.PatArchiveOut"
             resultMap="PatArchiveOutResult">
         <include refid="selectPatArchiveOutVo"/>
-        <where>
+        where 1=1
             <if test="patientno != null  and patientno != ''">and patientno = #{patientno}</if>
             <if test="pattype != null  and pattype != ''">and pattype = #{pattype}</if>
             <if test="name != null  and name != ''">and name like concat('%', #{name}, '%')</if>
@@ -104,7 +104,6 @@
             <if test="pid != null ">and pid = #{pid}</if>
             <if test="guid != null  and guid != ''">and guid = #{guid}</if>
             <if test="membertype != null  and membertype != ''">and membertype = #{membertype}</if>
-        </where>
     </select>
 
     <select id="selectPatArchiveOutByPatid" parameterType="Long" resultMap="PatArchiveOutResult">
@@ -116,8 +115,11 @@
         select aa.name1 as name, aa.count as count
         from (
         SELECT "浣忛櫌" as name1, count(1) as count FROM `pat_med_inhosp`
-        <where>
-            del_flag = 0 and endtime = null
+        where 1=1
+            and del_flag = 0 and endtime = null
+            <if test="orgid != null and orgid != ''">
+                AND orgid = #{orgid}
+            </if>
             <if test="deptIds != null ">and deptId in
                 <foreach collection="deptIds" item="deptId" open="(" separator="," close=")">
                     #{deptId}
@@ -128,11 +130,13 @@
                     #{drCode}
                 </foreach>
             </if>
-        </where>
         union
         select "鍑洪櫌" name1, count(1) as count FROM `pat_med_inhosp`
-        <where>
-            del_flag=0 and endtime != null
+        where 1=1
+            and del_flag = 0 and endtime != null
+            <if test="orgid != null and orgid != ''">
+                AND orgid = #{orgid}
+            </if>
             <if test="deptIds != null ">and deptId in
                 <foreach collection="deptIds" item="deptId" open="(" separator="," close=")">
                     #{deptId}
@@ -143,7 +147,6 @@
                     #{drCode}
                 </foreach>
             </if>
-        </where>
         union
         select "闂ㄨ瘖" name1, count(1) as count FROM `pat_med_outhosp`
         where del_flag=0
diff --git a/smartor/src/main/resources/mapper/smartor/PatArchivecontactMapper.xml b/smartor/src/main/resources/mapper/smartor/PatArchivecontactMapper.xml
index e2d6121..095cb27 100644
--- a/smartor/src/main/resources/mapper/smartor/PatArchivecontactMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/PatArchivecontactMapper.xml
@@ -48,8 +48,8 @@
     <select id="selectPatArchivecontactList" parameterType="com.smartor.domain.PatArchivecontact"
             resultMap="PatArchivecontactResult">
         <include refid="selectPatArchivecontactVo"/>
-        <where>
-            del_flag=0
+        where 1=1
+            and del_flag = 0
             <if test="patid != null ">and patid = #{patid}</if>
             <if test="contactway != null  and contactway != ''">and contactway = #{contactway}</if>
             <if test="relation != null ">and relation = #{relation}</if>
@@ -63,7 +63,6 @@
             </if>
             <if test="pid != null ">and pid = #{pid}</if>
             <if test="guid != null  and guid != ''">and guid = #{guid}</if>
-        </where>
     </select>
 
     <select id="selectPatArchivecontactById" parameterType="Long" resultMap="PatArchivecontactResult">
diff --git a/smartor/src/main/resources/mapper/smartor/PatArchivetagMapper.xml b/smartor/src/main/resources/mapper/smartor/PatArchivetagMapper.xml
index 9dcda39..a74e5ac 100644
--- a/smartor/src/main/resources/mapper/smartor/PatArchivetagMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/PatArchivetagMapper.xml
@@ -56,15 +56,14 @@
         a.patid,
         b.tagname
         from pat_archivetag a ,base_tag b
-        <where>
-            a.tagid=b.tagid
+        where 1=1
+            and a.tagid=b.tagid
             <if test="tagcategoryid != null ">and a.tagcategoryid = #{tagcategoryid}</if>
             <if test="tagid != null ">and a.tagid = #{tagid}</if>
             <if test="orgid != null  and orgid != ''">and a.orgid = #{orgid}</if>
             <if test="isupload != null ">and a.isupload = #{isupload}</if>
             <if test="uploadTime != null ">and a.upload_time = #{uploadTime}</if>
             <if test="patid != null ">and a.patid = #{patid}</if>
-        </where>
     </select>
 
     <select id="selectPatArchivetagById" parameterType="Long" resultMap="PatArchivetagResult">
@@ -132,10 +131,9 @@
         <trim prefix="SET" suffixOverrides=",">
             <if test="delFlag != null and delFlag != ''">del_flag = #{delFlag},</if>
         </trim>
-        <where>
+        where 1=1
             <if test="tagid != null">and tagid = #{tagid}</if>
             <if test="patid != null">and patid = #{patid}</if>
-        </where>
     </delete>
 
     <delete id="deletePatArchivetagByIds" parameterType="String">
diff --git a/smartor/src/main/resources/mapper/smartor/PatFilterlistMapper.xml b/smartor/src/main/resources/mapper/smartor/PatFilterlistMapper.xml
index ee8d89d..2f19104 100644
--- a/smartor/src/main/resources/mapper/smartor/PatFilterlistMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/PatFilterlistMapper.xml
@@ -33,7 +33,7 @@
 
     <select id="selectPatFilterlistList" parameterType="com.smartor.domain.PatFilterlist" resultMap="PatFilterlistResult">
         <include refid="selectPatFilterlistVo"/>
-        <where>
+        where 1=1
             <if test="patid != null "> and patid = #{patid}</if>
             <if test="filtertype != null  and filtertype != ''"> and filtertype = #{filtertype}</if>
             <if test="filterdesc != null  and filterdesc != ''"> and filterdesc = #{filterdesc}</if>
@@ -48,7 +48,6 @@
             <if test="orgid != null  and orgid != ''"> and orgid = #{orgid}</if>
             <if test="pid != null "> and pid = #{pid}</if>
             <if test="guid != null  and guid != ''"> and guid = #{guid}</if>
-        </where>
     </select>
 
     <select id="selectPatFilterlistById" parameterType="Long" resultMap="PatFilterlistResult">
diff --git a/smartor/src/main/resources/mapper/smartor/PatHetaskRelevanceMapper.xml b/smartor/src/main/resources/mapper/smartor/PatHetaskRelevanceMapper.xml
index 05ce141..9e5dd6f 100644
--- a/smartor/src/main/resources/mapper/smartor/PatHetaskRelevanceMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/PatHetaskRelevanceMapper.xml
@@ -58,8 +58,8 @@
     <select id="selectPatTaskRelevanceList" parameterType="com.smartor.domain.PatTaskRelevance"
             resultMap="PatTaskRelevanceResult">
         <include refid="selectPatTaskRelevanceVo"/>
-        <where>
-            del_flag=0
+        where 1=1
+            and del_flag = 0
             <if test="patid != null ">and pat_id = #{patid}</if>
             <if test="orgid != null ">and orgid = #{orgid}</if>
             <if test="taskId != null ">and task_id = #{taskId}</if>
@@ -77,7 +77,6 @@
             <if test="visitTime != null ">and visit_time = #{visitTime}</if>
             <if test="receiveTime != null ">and receive_time = #{receiveTime}</if>
             <if test="operatePerson != null   and operatePerson != ''">and operate_person = #{operatePerson}</if>
-        </where>
     </select>
 
     <select id="selectPatTaskRelevanceById" parameterType="Long" resultMap="PatTaskRelevanceResult">
diff --git a/smartor/src/main/resources/mapper/smartor/PatMedBloodsugarMapper.xml b/smartor/src/main/resources/mapper/smartor/PatMedBloodsugarMapper.xml
index bf83bc7..2582075 100644
--- a/smartor/src/main/resources/mapper/smartor/PatMedBloodsugarMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/PatMedBloodsugarMapper.xml
@@ -52,7 +52,7 @@
     <select id="selectPatMedBloodsugarList" parameterType="com.smartor.domain.PatMedBloodsugar"
             resultMap="PatMedBloodsugarResult">
         <include refid="selectPatMedBloodsugarVo"/>
-        <where>
+        where 1=1
             <if test="serialnum != null  and serialnum != ''">and serialnum = #{serialnum}</if>
             <if test="recordtime != null ">and recordtime = #{recordtime}</if>
             <if test="orgid != null  and orgid != ''">and orgid = #{orgid}</if>
@@ -65,7 +65,6 @@
             <if test="sugarlevelempty != null ">and sugarlevelempty = #{sugarlevelempty}</if>
             <if test="visittype != null ">and visittype = #{visittype}</if>
             <if test="visitid != null ">and visitid = #{visitid}</if>
-        </where>
     </select>
 
     <select id="selectPatMedBloodsugarByBloodsugarid" parameterType="Long" resultMap="PatMedBloodsugarResult">
diff --git a/smartor/src/main/resources/mapper/smartor/PatMedDrugMapper.xml b/smartor/src/main/resources/mapper/smartor/PatMedDrugMapper.xml
index 8fb6260..bf91627 100644
--- a/smartor/src/main/resources/mapper/smartor/PatMedDrugMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/PatMedDrugMapper.xml
@@ -61,7 +61,7 @@
 
     <select id="selectPatMedDrugList" parameterType="com.smartor.domain.PatMedDrug" resultMap="PatMedDrugResult">
         <include refid="selectPatMedDrugVo"/>
-        <where>
+        where 1=1
             <if test="serialnum != null  and serialnum != ''">and serialnum = #{serialnum}</if>
             <if test="patid != null ">and patid = #{patid}</if>
             <if test="drugname != null  and drugname != ''">and drugname like concat('%', #{drugname}, '%')</if>
@@ -79,7 +79,6 @@
             <if test="visitid != null ">and visitid = #{visitid}</if>
             <if test="schemestatus != null ">and schemestatus = #{schemestatus}</if>
             <if test="schemetime != null ">and schemetime = #{schemetime}</if>
-        </where>
     </select>
 
     <select id="selectPatMedDrugById" parameterType="Long" resultMap="PatMedDrugResult">
diff --git a/smartor/src/main/resources/mapper/smartor/PatMedHypertensionMapper.xml b/smartor/src/main/resources/mapper/smartor/PatMedHypertensionMapper.xml
index 2cbe423..cd04a26 100644
--- a/smartor/src/main/resources/mapper/smartor/PatMedHypertensionMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/PatMedHypertensionMapper.xml
@@ -54,7 +54,7 @@
     <select id="selectPatMedHypertensionList" parameterType="com.smartor.domain.PatMedHypertension"
             resultMap="PatMedHypertensionResult">
         <include refid="selectPatMedHypertensionVo"/>
-        <where>
+        where 1=1
             <if test="serialnum != null  and serialnum != ''">and serialnum = #{serialnum}</if>
             <if test="recordtime != null ">and recordtime = #{recordtime}</if>
             <if test="typename != null  and typename != ''">and typename like concat('%', #{typename}, '%')</if>
@@ -68,7 +68,6 @@
             <if test="heartrate != null ">and heartrate = #{heartrate}</if>
             <if test="visittype != null ">and visittype = #{visittype}</if>
             <if test="visitid != null ">and visitid = #{visitid}</if>
-        </where>
     </select>
 
     <select id="selectPatMedHypertensionById" parameterType="Long" resultMap="PatMedHypertensionResult">
diff --git a/smartor/src/main/resources/mapper/smartor/PatMedInhospMapper.xml b/smartor/src/main/resources/mapper/smartor/PatMedInhospMapper.xml
index 540e215..5e0594e 100644
--- a/smartor/src/main/resources/mapper/smartor/PatMedInhospMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/PatMedInhospMapper.xml
@@ -214,8 +214,8 @@
         pat_archive a ON a.id = b.patid
         LEFT JOIN
         pat_archivetag c ON c.patid = a.id AND (c.del_flag = 0 OR c.del_flag IS NULL)
-        <where>
-            a.del_flag = 0
+        where 1=1
+            AND a.del_flag = 0
             AND b.del_flag = 0
             AND a.idcardno IS NOT NULL
             <if test="startOutHospTime != null ">and date_format(b.endtime,'%y%m%d') &gt;=
@@ -289,7 +289,6 @@
                     #{leaveldeptcode}
                 </foreach>
             </if>
-        </where>
         GROUP BY
         b.inhospid,
         a.age,
@@ -370,11 +369,13 @@
         b.fuspecialadvice
         FROM
         pat_med_inhosp b
-
-        <where>
-            <if test="serialnum != null ">and b.serialnum = #{serialnum}</if>
-
-        </where>
+        where 1=1
+        <if test="orgid != null and orgid != ''">
+            and orgid = #{orgid}
+        </if>
+        <if test="serialnum != null ">
+            and b.serialnum = #{serialnum}
+        </if>
         order by b.inhospid desc
     </select>
 
@@ -448,51 +449,53 @@
         FROM
         pat_med_inhosp b,
         pat_archive a
-        <where>
-            a.del_flag=0
-            and b.del_flag=0
-            and a.id = b.patid
-            AND a.idcardno != ''
-            <if test="hospitalname != null  and hospitalname != ''">and hospitalname like concat('%', #{hospitalname},
-                '%')
-            </if>
-            <if test="managementDoctor != null ">and b.management_doctor = #{managementDoctor}</if>
-            <if test="managementDoctorCode != null ">and b.management_doctor_code = #{managementDoctorCode}</if>
-            <if test="patname != null  and patname != ''">and patname like concat('%', #{patname}, '%')</if>
-            <if test="hospitaldistrictname != null  and hospitaldistrictname != ''">and hospitaldistrictname like
-                concat('%', #{hospitaldistrictname}, '%')
-            </if>
-            <if test="endtime != null ">and b.endtime = #{endtime}</if>
-            <if test="serialnum != null ">and b.serialnum = #{serialnum}</if>
-            <if test="fuflag != null ">and b.fuflag = #{fuflag}</if>
-            <if test="nurseId != null ">and b.nurse_id = #{nurseId}</if>
-            <if test="nurseName != null ">and b.nurse_name = #{nurseName}</if>
-            <if test="patno != null ">and b.patno = #{patno}</if>
-            <if test="campusid != null ">and b.campusid = #{campusid}</if>
-            <if test="diagcheckFlag != null ">and b.diagcheck_flag = #{diagcheckFlag}</if>
-            <if test="deptcheckFlag != null ">and b.deptcheck_flag = #{deptcheckFlag}</if>
-            <if test="wardcheckFlag != null ">and b.wardcheck_flag = #{wardcheckFlag}</if>
-            <if test="inhospstate != null ">and b.inhospstate = #{inhospstate}</if>
-            <if test="schemestatus != null ">and b.schemestatus = #{schemestatus}</if>
-            <if test="leavediagname != null  and leavediagname != ''">and b.leavediagname like concat('%',
-                #{leavediagname}, '%')
-            </if>
-            <if test="drname != null  and drname != ''">and b.drname like concat('%', #{drname}, '%')</if>
-            <if test="leavehospitaldistrictcodes != null and leavehospitaldistrictcodes.size()>0">
-                AND b.leavehospitaldistrictcode IN
-                <foreach collection="leavehospitaldistrictcodes" item="leavehospitaldistrictcode" open="(" separator=","
-                         close=")">
-                    #{leavehospitaldistrictcode}
-                </foreach>
-            </if>
-            <if test="leaveldeptcodes != null and leaveldeptcodes.size()>0">
-                AND b.leaveldeptcode IN
-                <foreach collection="leaveldeptcodes" item="leaveldeptcode" open="(" separator=","
-                         close=")">
-                    #{leaveldeptcode}
-                </foreach>
-            </if>
-        </where>
+        where 1=1
+        and a.del_flag=0
+        and b.del_flag=0
+        and a.id = b.patid
+        AND a.idcardno != ''
+        <if test="orgid != null and orgid != ''">
+            and a.orgid = #{orgid}
+        </if>
+        <if test="hospitalname != null  and hospitalname != ''">and hospitalname like concat('%', #{hospitalname},
+            '%')
+        </if>
+        <if test="managementDoctor != null ">and b.management_doctor = #{managementDoctor}</if>
+        <if test="managementDoctorCode != null ">and b.management_doctor_code = #{managementDoctorCode}</if>
+        <if test="patname != null  and patname != ''">and patname like concat('%', #{patname}, '%')</if>
+        <if test="hospitaldistrictname != null  and hospitaldistrictname != ''">and hospitaldistrictname like
+            concat('%', #{hospitaldistrictname}, '%')
+        </if>
+        <if test="endtime != null ">and b.endtime = #{endtime}</if>
+        <if test="serialnum != null ">and b.serialnum = #{serialnum}</if>
+        <if test="fuflag != null ">and b.fuflag = #{fuflag}</if>
+        <if test="nurseId != null ">and b.nurse_id = #{nurseId}</if>
+        <if test="nurseName != null ">and b.nurse_name = #{nurseName}</if>
+        <if test="patno != null ">and b.patno = #{patno}</if>
+        <if test="campusid != null ">and b.campusid = #{campusid}</if>
+        <if test="diagcheckFlag != null ">and b.diagcheck_flag = #{diagcheckFlag}</if>
+        <if test="deptcheckFlag != null ">and b.deptcheck_flag = #{deptcheckFlag}</if>
+        <if test="wardcheckFlag != null ">and b.wardcheck_flag = #{wardcheckFlag}</if>
+        <if test="inhospstate != null ">and b.inhospstate = #{inhospstate}</if>
+        <if test="schemestatus != null ">and b.schemestatus = #{schemestatus}</if>
+        <if test="leavediagname != null  and leavediagname != ''">and b.leavediagname like concat('%',
+            #{leavediagname}, '%')
+        </if>
+        <if test="drname != null  and drname != ''">and b.drname like concat('%', #{drname}, '%')</if>
+        <if test="leavehospitaldistrictcodes != null and leavehospitaldistrictcodes.size()>0">
+            AND b.leavehospitaldistrictcode IN
+            <foreach collection="leavehospitaldistrictcodes" item="leavehospitaldistrictcode" open="(" separator=","
+                     close=")">
+                #{leavehospitaldistrictcode}
+            </foreach>
+        </if>
+        <if test="leaveldeptcodes != null and leaveldeptcodes.size()>0">
+            AND b.leaveldeptcode IN
+            <foreach collection="leaveldeptcodes" item="leaveldeptcode" open="(" separator=","
+                     close=")">
+                #{leaveldeptcode}
+            </foreach>
+        </if>
         order by b.inhospid desc
     </select>
 
@@ -857,15 +860,17 @@
         <if test="mz != null">
             SELECT deptname
             FROM pat_med_outhosp
-            <where>
-                del_flag=0
-                <if test="deptcodeList != null   and deptcodeList.size() > 0">
-                    and deptcode in
-                    <foreach collection="deptcodeList" item="deptcode" open="(" separator="," close=")">
-                        #{deptcode}
-                    </foreach>
-                </if>
-            </where>
+            where 1=1
+            and del_flag=0
+            <if test="deptcodeList != null   and deptcodeList.size() > 0">
+                and deptcode in
+                <foreach collection="deptcodeList" item="deptcode" open="(" separator="," close=")">
+                    #{deptcode}
+                </foreach>
+            </if>
+            <if test="orgid != null and orgid != ''">
+                and orgid = #{orgid}
+            </if>
         </if>
         <if test="mz != null and zy != null">
             UNION ALL
@@ -873,46 +878,52 @@
         <if test="zy != null">
             SELECT deptname
             FROM pat_med_inhosp
-            <where>
-                del_flag=0
-                and inhospstate=0
-                <if test="deptcodeList != null   and deptcodeList.size() > 0">
-                    and deptcode in
-                    <foreach collection="deptcodeList" item="deptcode" open="(" separator="," close=")">
-                        #{deptcode}
-                    </foreach>
-                </if>
-            </where>
+            where 1=1
+            and del_flag=0
+            and inhospstate=0
+            <if test="deptcodeList != null   and deptcodeList.size() > 0">
+                and deptcode in
+                <foreach collection="deptcodeList" item="deptcode" open="(" separator="," close=")">
+                    #{deptcode}
+                </foreach>
+            </if>
+            <if test="orgid != null and orgid != ''">
+                and orgid = #{orgid}
+            </if>
         </if>
         <if test="cy != null and zy != null">
             UNION ALL
             SELECT deptname
             FROM pat_med_inhosp
-            <where>
-                del_flag=0
-                and inhospstate=1
-                <if test="deptcodeList != null   and deptcodeList.size() > 0">
-                    and deptcode in
-                    <foreach collection="deptcodeList" item="deptcode" open="(" separator="," close=")">
-                        #{deptcode}
-                    </foreach>
-                </if>
-            </where>
+            where 1=1
+            and del_flag=0
+            and inhospstate=1
+            <if test="deptcodeList != null   and deptcodeList.size() > 0">
+                and deptcode in
+                <foreach collection="deptcodeList" item="deptcode" open="(" separator="," close=")">
+                    #{deptcode}
+                </foreach>
+            </if>
+            <if test="orgid != null and orgid != ''">
+                and orgid = #{orgid}
+            </if>
         </if>
         <if test="mz != null and zy != null and cy==null">
             UNION ALL
             SELECT deptname
             FROM pat_med_inhosp
-            <where>
-                del_flag=0
-                and inhospstate=1
-                <if test="deptcodeList != null   and deptcodeList.size() > 0">
-                    and deptcode in
-                    <foreach collection="deptcodeList" item="deptcode" open="(" separator="," close=")">
-                        #{deptcode}
-                    </foreach>
-                </if>
-            </where>
+            where 1=1
+            and del_flag=0
+            and inhospstate=1
+            <if test="deptcodeList != null   and deptcodeList.size() > 0">
+                and deptcode in
+                <foreach collection="deptcodeList" item="deptcode" open="(" separator="," close=")">
+                    #{deptcode}
+                </foreach>
+            </if>
+            <if test="orgid != null and orgid != ''">
+                and orgid = #{orgid}
+            </if>
         </if>
         ) AS combined
         GROUP BY deptname;
@@ -934,34 +945,33 @@
         0 AS zbsf
         FROM
         pat_med_inhosp
-        <where>
-            del_flag=0
-            <if test="orgid != null">
-                AND orgid = #{orgid}
+        where 1=1
+        and del_flag=0
+        <if test="orgid != null and orgid != ''">
+            and orgid = #{orgid}
+        </if>
+        <if test="zy != null">
+            and inhospstate=0
+            and date_format(starttime,'%y%m%d') &gt;= date_format(#{startDate},'%y%m%d')
+            and date_format(starttime,'%y%m%d') &lt;= date_format(#{endDate},'%y%m%d')
+            <if test="deptcodeList != null   and deptcodeList.size() > 0">
+                and deptcode in
+                <foreach collection="deptcodeList" item="deptcode" open="(" separator="," close=")">
+                    #{deptcode}
+                </foreach>
             </if>
-            <if test="zy != null">
-                and inhospstate=0
-                and date_format(starttime,'%y%m%d') &gt;= date_format(#{startDate},'%y%m%d')
-                and date_format(starttime,'%y%m%d') &lt;= date_format(#{endDate},'%y%m%d')
-                <if test="deptcodeList != null   and deptcodeList.size() > 0">
-                    and deptcode in
-                    <foreach collection="deptcodeList" item="deptcode" open="(" separator="," close=")">
-                        #{deptcode}
-                    </foreach>
-                </if>
+        </if>
+        <if test="cy != null">
+            and inhospstate=1
+            and date_format(endtime,'%y%m%d') &gt;= date_format(#{startDate},'%y%m%d')
+            and date_format(endtime,'%y%m%d') &lt;= date_format(#{endDate},'%y%m%d')
+            <if test="deptcodeList != null   and deptcodeList.size() > 0">
+                and leaveldeptcode in
+                <foreach collection="deptcodeList" item="deptcode" open="(" separator="," close=")">
+                    #{deptcode}
+                </foreach>
             </if>
-            <if test="cy != null">
-                and inhospstate=1
-                and date_format(endtime,'%y%m%d') &gt;= date_format(#{startDate},'%y%m%d')
-                and date_format(endtime,'%y%m%d') &lt;= date_format(#{endDate},'%y%m%d')
-                <if test="deptcodeList != null   and deptcodeList.size() > 0">
-                    and leaveldeptcode in
-                    <foreach collection="deptcodeList" item="deptcode" open="(" separator="," close=")">
-                        #{deptcode}
-                    </foreach>
-                </if>
-            </if>
-        </where>
+        </if>
         <!-- 闅忚鏈嶅姟浜烘暟 -->
         union all
         select
@@ -972,25 +982,24 @@
         0 AS zbsf
         FROM
         service_subtask
-        <where>
-            del_flag = 0
-            and service_type=2
-            <if test="orgid != null">
-                AND orgid = #{orgid}
-            </if>
-            <if test="startDate != null">
-                AND date_format( visit_time, '%y%m%d' ) &gt;= date_format( #{startDate}, '%y%m%d' )
-            </if>
-            <if test="endDate != null">
-                AND date_format( visit_time, '%y%m%d' ) &lt;= date_format(#{endDate},'%y%m%d')
-            </if>
-            <if test="deptcodeList != null   and deptcodeList.size() > 0">
-                and deptcode in
-                <foreach collection="deptcodeList" item="deptcode" open="(" separator="," close=")">
-                    #{deptcode}
-                </foreach>
-            </if>
-        </where>
+        where 1=1
+        and del_flag = 0
+        and service_type=2
+        <if test="orgid != null and orgid != ''">
+            and orgid = #{orgid}
+        </if>
+        <if test="startDate != null">
+            AND date_format( visit_time, '%y%m%d' ) &gt;= date_format( #{startDate}, '%y%m%d' )
+        </if>
+        <if test="endDate != null">
+            AND date_format( visit_time, '%y%m%d' ) &lt;= date_format(#{endDate},'%y%m%d')
+        </if>
+        <if test="deptcodeList != null   and deptcodeList.size() > 0">
+            and deptcode in
+            <foreach collection="deptcodeList" item="deptcode" open="(" separator="," close=")">
+                #{deptcode}
+            </foreach>
+        </if>
         <!-- 棣栨闅忚浜烘暟 -->
         union all
         select
@@ -1001,26 +1010,25 @@
         0 AS zbsf
         FROM
         service_subtask
-        <where>
-            del_flag = 0
-            and service_type=2
-            and is_visit_again = 0
-            <if test="orgid != null">
-                AND orgid = #{orgid}
-            </if>
-            <if test="startDate != null">
-                AND date_format( visit_time, '%y%m%d' ) &gt;= date_format( #{startDate}, '%y%m%d' )
-            </if>
-            <if test="endDate != null">
-                AND date_format( visit_time, '%y%m%d' ) &lt;= date_format(#{endDate},'%y%m%d')
-            </if>
-            <if test="deptcodeList != null   and deptcodeList.size() > 0">
-                and deptcode in
-                <foreach collection="deptcodeList" item="deptcode" open="(" separator="," close=")">
-                    #{deptcode}
-                </foreach>
-            </if>
-        </where>
+        where 1=1
+        and del_flag = 0
+        and service_type=2
+        and is_visit_again = 0
+        <if test="orgid != null and orgid != ''">
+            and orgid = #{orgid}
+        </if>
+        <if test="startDate != null">
+            AND date_format( visit_time, '%y%m%d' ) &gt;= date_format( #{startDate}, '%y%m%d' )
+        </if>
+        <if test="endDate != null">
+            AND date_format( visit_time, '%y%m%d' ) &lt;= date_format(#{endDate},'%y%m%d')
+        </if>
+        <if test="deptcodeList != null   and deptcodeList.size() > 0">
+            and deptcode in
+            <foreach collection="deptcodeList" item="deptcode" open="(" separator="," close=")">
+                #{deptcode}
+            </foreach>
+        </if>
         <!-- 鍐嶆闅忚浜烘暟 -->
         union all
         select
@@ -1031,26 +1039,25 @@
         0 AS zbsf
         FROM
         service_subtask
-        <where>
-            del_flag = 0
-            and service_type=2
-            and is_visit_again = 1
-            <if test="orgid != null">
-                AND orgid = #{orgid}
-            </if>
-            <if test="startDate != null">
-                AND date_format( visit_time, '%y%m%d' ) &gt;= date_format( #{startDate}, '%y%m%d' )
-            </if>
-            <if test="endDate != null">
-                AND date_format( visit_time, '%y%m%d' ) &lt;= date_format(#{endDate},'%y%m%d')
-            </if>
-            <if test="deptcodeList != null   and deptcodeList.size() > 0">
-                and deptcode in
-                <foreach collection="deptcodeList" item="deptcode" open="(" separator="," close=")">
-                    #{deptcode}
-                </foreach>
-            </if>
-        </where>
+        where 1=1
+        and del_flag = 0
+        and service_type=2
+        and is_visit_again = 1
+        <if test="orgid != null and orgid != ''">
+            and orgid = #{orgid}
+        </if>
+        <if test="startDate != null">
+            AND date_format( visit_time, '%y%m%d' ) &gt;= date_format( #{startDate}, '%y%m%d' )
+        </if>
+        <if test="endDate != null">
+            AND date_format( visit_time, '%y%m%d' ) &lt;= date_format(#{endDate},'%y%m%d')
+        </if>
+        <if test="deptcodeList != null   and deptcodeList.size() > 0">
+            and deptcode in
+            <foreach collection="deptcodeList" item="deptcode" open="(" separator="," close=")">
+                #{deptcode}
+            </foreach>
+        </if>
         <!-- 涓撶梾闅忚浜烘暟 -->
         union all
         select
@@ -1061,25 +1068,24 @@
         count(1) AS zbsf
         FROM
         service_subtask
-        <where>
-            del_flag = 0
-            and service_type=13
-            <if test="orgid != null">
-                AND orgid = #{orgid}
-            </if>
-            <if test="startDate != null">
-                AND date_format( visit_time, '%y%m%d' ) &gt;= date_format( #{startDate}, '%y%m%d' )
-            </if>
-            <if test="endDate != null">
-                AND date_format( visit_time, '%y%m%d' ) &lt;= date_format(#{endDate},'%y%m%d')
-            </if>
-            <if test="deptcodeList != null   and deptcodeList.size() > 0">
-                and deptcode in
-                <foreach collection="deptcodeList" item="deptcode" open="(" separator="," close=")">
-                    #{deptcode}
-                </foreach>
-            </if>
-        </where>
+        where 1=1
+        and del_flag = 0
+        and service_type=13
+        <if test="orgid != null and orgid != ''">
+            and orgid = #{orgid}
+        </if>
+        <if test="startDate != null">
+            AND date_format( visit_time, '%y%m%d' ) &gt;= date_format( #{startDate}, '%y%m%d' )
+        </if>
+        <if test="endDate != null">
+            AND date_format( visit_time, '%y%m%d' ) &lt;= date_format(#{endDate},'%y%m%d')
+        </if>
+        <if test="deptcodeList != null   and deptcodeList.size() > 0">
+            and deptcode in
+            <foreach collection="deptcodeList" item="deptcode" open="(" separator="," close=")">
+                #{deptcode}
+            </foreach>
+        </if>
         ) AS combined_data
     </select>
 
diff --git a/smartor/src/main/resources/mapper/smartor/PatMedInspectionItemMapper.xml b/smartor/src/main/resources/mapper/smartor/PatMedInspectionItemMapper.xml
index 14392f7..a7470bf 100644
--- a/smartor/src/main/resources/mapper/smartor/PatMedInspectionItemMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/PatMedInspectionItemMapper.xml
@@ -74,7 +74,7 @@
     <select id="selectPatMedInspectionItemList" parameterType="com.smartor.domain.PatMedInspectionItem"
             resultMap="PatMedInspectionItemResult">
         <include refid="selectPatMedInspectionItemVo"/>
-        <where>
+        where 1=1
             <if test="inspectionid != null  and inspectionid != ''">and inspectionid = #{inspectionid}</if>
             <if test="inspectionName != null  and inspectionName != ''">and inspection_name = #{inspectionName}</if>
             <if test="reportid != null  and reportid != ''">and reportid = #{reportid}</if>
@@ -104,7 +104,6 @@
             <if test="pguid != null  and pguid != ''">and pguid = #{pguid}</if>
             <if test="guid != null  and guid != ''">and guid = #{guid}</if>
             <if test="pid != null  and pid != ''">and pid = #{pid}</if>
-        </where>
 --         order by update_time desc
     </select>
 
diff --git a/smartor/src/main/resources/mapper/smartor/PatMedInspectionMapper.xml b/smartor/src/main/resources/mapper/smartor/PatMedInspectionMapper.xml
index ecab3cc..3a660f3 100644
--- a/smartor/src/main/resources/mapper/smartor/PatMedInspectionMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/PatMedInspectionMapper.xml
@@ -98,7 +98,7 @@
     <select id="selectPatMedInspectionList" parameterType="com.smartor.domain.PatMedInspection"
             resultMap="PatMedInspectionResult">
         <include refid="selectPatMedInspectionVo"/>
-        <where>
+        where 1=1
             <if test="projecttype != null">and projecttype = #{projecttype}</if>
             <if test="inhospno != null">and inhospno = #{inhospno}</if>
             <if test="patidHis != null">and patid_his = #{patidHis}</if>
@@ -140,7 +140,6 @@
             <if test="pguid != null">and pguid = #{pguid}</if>
             <if test="guid != null">and guid = #{guid}</if>
             <if test="pid != null">and pid = #{pid}</if>
-        </where>
 --         order by update_time desc
     </select>
 
diff --git a/smartor/src/main/resources/mapper/smartor/PatMedOperationItemMapper.xml b/smartor/src/main/resources/mapper/smartor/PatMedOperationItemMapper.xml
index afc4fc1..0859f44 100644
--- a/smartor/src/main/resources/mapper/smartor/PatMedOperationItemMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/PatMedOperationItemMapper.xml
@@ -37,7 +37,7 @@
     <select id="selectPatMedOperationItemList" parameterType="com.smartor.domain.PatMedOperationItem"
             resultMap="PatMedOperationItemResult">
         <include refid="selectPatMedOperationItemVo"/>
-        <where>
+        where 1=1
                         <if test="operationid != null ">
                             and operationid = #{operationid}
                         </if>
@@ -86,7 +86,6 @@
                         <if test="pid != null ">
                             and pid = #{pid}
                         </if>
-        </where>
     </select>
 
     <select id="selectPatMedOperationItemById" parameterType="Long"
diff --git a/smartor/src/main/resources/mapper/smartor/PatMedOperationMapper.xml b/smartor/src/main/resources/mapper/smartor/PatMedOperationMapper.xml
index aba4680..092198d 100644
--- a/smartor/src/main/resources/mapper/smartor/PatMedOperationMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/PatMedOperationMapper.xml
@@ -156,8 +156,8 @@
     <select id="selectPatMedOperationList" parameterType="com.smartor.domain.PatMedOperation"
             resultMap="PatMedOperationResult">
         <include refid="selectPatMedOperationVo"/>
-        <where>
-            del_flag='0'
+        where 1=1
+            and del_flag='0'
             <if test="patid != null ">
                 and patid = #{patid}
             </if>
@@ -356,7 +356,6 @@
             <if test="opleveldesc != null  and opleveldesc != ''">
                 and opleveldesc = #{opleveldesc}
             </if>
-        </where>
     </select>
 
     <select id="selectPatMedOperationById" parameterType="Long"
diff --git a/smartor/src/main/resources/mapper/smartor/PatMedOuthospMapper.xml b/smartor/src/main/resources/mapper/smartor/PatMedOuthospMapper.xml
index 68bc33f..1f482fc 100644
--- a/smartor/src/main/resources/mapper/smartor/PatMedOuthospMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/PatMedOuthospMapper.xml
@@ -121,8 +121,8 @@
         pmo.patname,
         pmo.mainsuit
         from pat_med_outhosp pmo
-        <where>
-            pmo.del_flag=0
+        where 1=1
+            and pmo.del_flag=0
             <if test="orgid != null ">and pmo.orgid = #{orgid}</if>
             <if test="serialnum != null ">and pmo.serialnum = #{serialnum}</if>
             <if test="serverState != null ">and pmo.server_state = #{serverState}</if>
@@ -153,7 +153,6 @@
             <if test="outhospno != null  and outhospno != ''">and pmo.outhospno = #{outhospno}</if>
             <if test="diagcheckFlag != null  and diagcheckFlag != ''">and pmo.diagcheck_flag = #{diagcheckFlag}</if>
             <if test="diagname != null  and diagname != ''">and pmo.diagname like concat('%',#{diagname}, '%')</if>
-        </where>
         order by pmo.update_time desc
     </select>
 
@@ -460,8 +459,8 @@
         0 AS rs
         FROM
         pat_med_outhosp
-        <where>
-            del_flag=0
+        where 1=1
+            and del_flag = 0
             <if test="orgid != null">
                 and orgid = #{orgid}
             </if>
@@ -473,15 +472,14 @@
                     #{deptcode}
                 </foreach>
             </if>
-        </where>
         union all
         select
         0 AS rc,
         count(1) AS rs
         FROM
         service_subtask
-        <where>
-            del_flag = 0
+        where 1=1
+            and del_flag = 0
             and service_type=3
             <if test="orgid != null">
                 and orgid = #{orgid}
@@ -498,15 +496,17 @@
                     #{deptcode}
                 </foreach>
             </if>
-        </where>
         ) AS combined_data
     </select>
 
     <select id="getDeptRanking" parameterType="com.smartor.domain.PatMedReq" resultType="com.smartor.domain.PatMedRes">
         SELECT deptname, COUNT(1) AS rc
         FROM pat_med_outhosp
-        <where>
-            del_flag=0
+        where 1=1
+            and del_flag = 0
+            <if test="orgid != null  and orgid != ''">
+                and orgid = #{orgid}
+            </if>
             <if test="inhospstate != null">
                 and inhospstate= #{inhospstate}
             </if>
@@ -519,7 +519,6 @@
                     #{deptcode}
                 </foreach>
             </if>
-        </where>
     </select>
 
     <!-- PatMedOuthospMapper.xml -->
diff --git a/smartor/src/main/resources/mapper/smartor/PatMedOuthospProvisionalMapper.xml b/smartor/src/main/resources/mapper/smartor/PatMedOuthospProvisionalMapper.xml
index c2d0e9c..d83285f 100644
--- a/smartor/src/main/resources/mapper/smartor/PatMedOuthospProvisionalMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/PatMedOuthospProvisionalMapper.xml
@@ -53,8 +53,8 @@
     <select id="selectPatMedOuthospProvisionalList" parameterType="com.smartor.domain.PatMedOuthospProvisional"
             resultMap="PatMedOuthospProvisionalResult">
         <include refid="selectPatMedOuthospProvisionalVo"/>
-        <where>
-            del_flag=0
+        where 1=1
+            and del_flag = 0
                         <if test="outhospno != null  and outhospno != ''">
                             and outhospno = #{outhospno}
                         </if>
@@ -148,7 +148,6 @@
                         <if test="campusid != null  and campusid != ''">
                             and campusid = #{campusid}
                         </if>
-        </where>
     </select>
 
     <select id="selectPatMedOuthospProvisionalById" parameterType="Long"
diff --git a/smartor/src/main/resources/mapper/smartor/PatMedPhysicalMapper.xml b/smartor/src/main/resources/mapper/smartor/PatMedPhysicalMapper.xml
index 2969c66..34a4cda 100644
--- a/smartor/src/main/resources/mapper/smartor/PatMedPhysicalMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/PatMedPhysicalMapper.xml
@@ -42,7 +42,7 @@
 
     <select id="selectPatMedPhysicalList" parameterType="com.smartor.domain.PatMedPhysical" resultMap="PatMedPhysicalResult">
         <include refid="selectPatMedPhysicalVo"/>
-        <where>
+        where 1=1
             <if test="hospitalname != null  and hospitalname != ''"> and hospitalname like concat('%', #{hospitalname}, '%')</if>
             <if test="physicaldate != null "> and physicaldate = #{physicaldate}</if>
             <if test="orgid != null  and orgid != ''"> and orgid = #{orgid}</if>
@@ -50,7 +50,6 @@
             <if test="deptname != null  and deptname != ''"> and deptname like concat('%', #{deptname}, '%')</if>
             <if test="patname != null  and patname != ''"> and patname like concat('%', #{patname}, '%')</if>
             <if test="projectname != null  and projectname != ''"> and projectname like concat('%', #{projectname}, '%')</if>
-        </where>
     </select>
 
     <select id="selectPatMedPhysicalById" parameterType="Long" resultMap="PatMedPhysicalResult">
diff --git a/smartor/src/main/resources/mapper/smartor/PatMedRegistrationMapper.xml b/smartor/src/main/resources/mapper/smartor/PatMedRegistrationMapper.xml
index 97ab1e8..7153f3e 100644
--- a/smartor/src/main/resources/mapper/smartor/PatMedRegistrationMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/PatMedRegistrationMapper.xml
@@ -62,7 +62,7 @@
     <select id="selectPatMedRegistrationList" parameterType="com.smartor.domain.PatMedRegistration"
             resultMap="PatMedRegistrationResult">
         <include refid="selectPatMedRegistrationVo"/>
-        <where>
+        where 1=1
             <if test="serialnum != null  and serialnum != ''">and serialnum = #{serialnum}</if>
             <if test="patid != null ">and patid = #{patid}</if>
             <if test="hospitalname != null  and hospitalname != ''">and hospitalname like concat('%', #{hospitalname},
@@ -83,7 +83,6 @@
             <if test="uploadTime != null ">and upload_time = #{uploadTime}</if>
             <if test="pid != null ">and pid = #{pid}</if>
             <if test="guid != null  and guid != ''">and guid = #{guid}</if>
-        </where>
         order by create_time desc
     </select>
 
diff --git a/smartor/src/main/resources/mapper/smartor/PatMedWeightMapper.xml b/smartor/src/main/resources/mapper/smartor/PatMedWeightMapper.xml
index eb5be69..40d2b19 100644
--- a/smartor/src/main/resources/mapper/smartor/PatMedWeightMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/PatMedWeightMapper.xml
@@ -31,7 +31,7 @@
 
     <select id="selectPatMedWeightList" parameterType="com.smartor.domain.PatMedWeight" resultMap="PatMedWeightResult">
         <include refid="selectPatMedWeightVo"/>
-        <where>
+        where 1=1
             <if test="serialnum != null  and serialnum != ''"> and serialnum = #{serialnum}</if>
             <if test="fatweight != null "> and fatweight = #{fatweight}</if>
             <if test="bodyweight != null "> and bodyweight = #{bodyweight}</if>
@@ -43,7 +43,6 @@
             <if test="sourcename != null  and sourcename != ''"> and sourcename like concat('%', #{sourcename}, '%')</if>
             <if test="visittype != null "> and visittype = #{visittype}</if>
             <if test="visitid != null "> and visitid = #{visitid}</if>
-        </where>
     </select>
 
     <select id="selectPatMedWeightById" parameterType="Long" resultMap="PatMedWeightResult">
diff --git a/smartor/src/main/resources/mapper/smartor/PatSatisfactionMapper.xml b/smartor/src/main/resources/mapper/smartor/PatSatisfactionMapper.xml
index 6619965..17eb494 100644
--- a/smartor/src/main/resources/mapper/smartor/PatSatisfactionMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/PatSatisfactionMapper.xml
@@ -58,8 +58,8 @@
     <select id="selectPatSatisfactionList" parameterType="com.smartor.domain.PatSatisfaction"
             resultMap="PatSatisfactionResult">
         <include refid="selectPatSatisfactionVo"/>
-        <where>
-            del_flag=0
+        where 1=1
+            and del_flag = 0
             <if test="patName != null  and patName != ''">
                 and pat_name like concat('%', #{patName}, '%')
             </if>
@@ -114,7 +114,6 @@
             <if test="endTime != null">
                 AND date_format(update_time,'%y%m%d') &lt;= date_format(#{endTime},'%y%m%d')
             </if>
-        </where>
     </select>
 
     <select id="selectPatSatisfactionById" parameterType="Long"
diff --git a/smartor/src/main/resources/mapper/smartor/PatSpeciallistCategoryMapper.xml b/smartor/src/main/resources/mapper/smartor/PatSpeciallistCategoryMapper.xml
index 21a55c1..9cc04e0 100644
--- a/smartor/src/main/resources/mapper/smartor/PatSpeciallistCategoryMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/PatSpeciallistCategoryMapper.xml
@@ -36,13 +36,12 @@
     <select id="selectPatSpeciallistCategoryList" parameterType="com.smartor.domain.PatSpeciallistCategory"
             resultMap="PatSpeciallistCategoryResult">
         <include refid="selectPatSpeciallistCategoryVo"/>
-        <where>
+        where 1=1
             <if test="name != null  and name != ''">and name like concat('%', #{name}, '%')</if>
             <if test="seqno != null ">and seqno = #{seqno}</if>
             <if test="pid != null ">and pid = #{pid}</if>
             <if test="guid != null  and guid != ''">and guid = #{guid}</if>
             <if test="orgid != null ">and orgid = #{orgid}</if>
-        </where>
     </select>
 
     <select id="selectPatSpeciallistCategoryById" parameterType="Long" resultMap="PatSpeciallistCategoryResult">
diff --git a/smartor/src/main/resources/mapper/smartor/PatSpeciallistMapper.xml b/smartor/src/main/resources/mapper/smartor/PatSpeciallistMapper.xml
index 187b28d..aa2056a 100644
--- a/smartor/src/main/resources/mapper/smartor/PatSpeciallistMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/PatSpeciallistMapper.xml
@@ -33,7 +33,7 @@
 
     <select id="selectPatSpeciallistList" parameterType="com.smartor.domain.PatSpeciallist" resultMap="PatSpeciallistResult">
         <include refid="selectPatSpeciallistVo"/>
-        <where>
+        where 1=1
             <if test="patid != null "> and patid = #{patid}</if>
             <if test="sdtype != null  and sdtype != ''"> and sdtype = #{sdtype}</if>
             <if test="sddesc != null  and sddesc != ''"> and sddesc = #{sddesc}</if>
@@ -48,7 +48,6 @@
             <if test="orgid != null  and orgid != ''"> and orgid = #{orgid}</if>
             <if test="pid != null "> and pid = #{pid}</if>
             <if test="guid != null  and guid != ''"> and guid = #{guid}</if>
-        </where>
     </select>
 
     <select id="selectPatSpeciallistById" parameterType="Long" resultMap="PatSpeciallistResult">
diff --git a/smartor/src/main/resources/mapper/smartor/PatWildcardMapper.xml b/smartor/src/main/resources/mapper/smartor/PatWildcardMapper.xml
index 1e55fde..bdb60da 100644
--- a/smartor/src/main/resources/mapper/smartor/PatWildcardMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/PatWildcardMapper.xml
@@ -33,10 +33,10 @@
 
     <select id="selectPatWildcardList" parameterType="com.smartor.domain.PatWildcard" resultMap="PatWildcardResult">
         <include refid="selectPatWildcardVo"/>
-        <where>
+        where 1=1
+            <if test="orgid != null  and orgid != ''">and orgid = #{orgid}</if>
             <if test="wildcard != null  and wildcard != ''">and wildcard = #{wildcard}</if>
             <if test="patField != null  and patField != ''">and pat_field = #{patField}</if>
-        </where>
     </select>
 
     <select id="selectPatWildcardById" parameterType="Long" resultMap="PatWildcardResult">
diff --git a/smartor/src/main/resources/mapper/smartor/SchemeAutofinshruleMapper.xml b/smartor/src/main/resources/mapper/smartor/SchemeAutofinshruleMapper.xml
index e321ebe..baac659 100644
--- a/smartor/src/main/resources/mapper/smartor/SchemeAutofinshruleMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/SchemeAutofinshruleMapper.xml
@@ -40,12 +40,11 @@
     <select id="selectSchemeAutofinshruleList" parameterType="SchemeAutofinshrule"
             resultMap="SchemeAutofinshruleResult">
         <include refid="selectSchemeAutofinshruleVo"/>
-        <where>
+        where 1=1
             <if test="schemeid != null ">and schemeid = #{schemeid}</if>
             <if test="ruletype != null ">and ruletype = #{ruletype}</if>
             <if test="rulevalue != null  and rulevalue != ''">and rulevalue = #{rulevalue}</if>
             <if test="orgid != null  and orgid != ''">and orgid = #{orgid}</if>
-        </where>
     </select>
 
     <select id="selectSchemeAutofinshruleById" parameterType="Long" resultMap="SchemeAutofinshruleResult">
diff --git a/smartor/src/main/resources/mapper/smartor/SchemeCategoryMapper.xml b/smartor/src/main/resources/mapper/smartor/SchemeCategoryMapper.xml
index 36bbd99..ba1330d 100644
--- a/smartor/src/main/resources/mapper/smartor/SchemeCategoryMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/SchemeCategoryMapper.xml
@@ -25,11 +25,10 @@
 
     <select id="selectSchemeCategoryList" parameterType="SchemeCategory" resultMap="SchemeCategoryResult">
         <include refid="selectSchemeCategoryVo"/>
-        <where>
+        where 1=1
             <if test="categoryname != null  and categoryname != ''"> and categoryname like concat('%', #{categoryname}, '%')</if>
             <if test="orgid != null  and orgid != ''"> and orgid = #{orgid}</if>
             <if test="iscurrency != null "> and iscurrency = #{iscurrency}</if>
-        </where>
     </select>
 
     <select id="selectSchemeCategoryById" parameterType="Long" resultMap="SchemeCategoryResult">
diff --git a/smartor/src/main/resources/mapper/smartor/SchemeLocallibraryMapper.xml b/smartor/src/main/resources/mapper/smartor/SchemeLocallibraryMapper.xml
index f0d043c..6e9aa62 100644
--- a/smartor/src/main/resources/mapper/smartor/SchemeLocallibraryMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/SchemeLocallibraryMapper.xml
@@ -47,7 +47,7 @@
 
     <select id="selectSchemeLocallibraryList" parameterType="SchemeLocallibrary" resultMap="SchemeLocallibraryResult">
         <include refid="selectSchemeLocallibraryVo"/>
-        <where>
+        where 1=1
             <if test="schemecategoryid != null "> and schemecategoryid = #{schemecategoryid}</if>
             <if test="schemename != null  and schemename != ''"> and schemename like concat('%', #{schemename}, '%')</if>
             <if test="description != null  and description != ''"> and description = #{description}</if>
@@ -75,7 +75,6 @@
             <if test="centerlibrarycode != null  and centerlibrarycode != ''"> and centerlibrarycode = #{centerlibrarycode}</if>
             <if test="islocal != null "> and islocal = #{islocal}</if>
             <if test="iscurrency != null "> and iscurrency = #{iscurrency}</if>
-        </where>
     </select>
 
     <select id="selectSchemeLocallibraryById" parameterType="Long" resultMap="SchemeLocallibraryResult">
diff --git a/smartor/src/main/resources/mapper/smartor/SchemePlanMapper.xml b/smartor/src/main/resources/mapper/smartor/SchemePlanMapper.xml
index d4f5fad..26d8449 100644
--- a/smartor/src/main/resources/mapper/smartor/SchemePlanMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/SchemePlanMapper.xml
@@ -37,7 +37,7 @@
 
     <select id="selectSchemePlanList" parameterType="SchemePlan" resultMap="SchemePlanResult">
         <include refid="selectSchemePlanVo"/>
-        <where>
+        where 1=1
             <if test="schemeid != null "> and schemeid = #{schemeid}</if>
             <if test="schemecode != null  and schemecode != ''"> and schemecode = #{schemecode}</if>
             <if test="patientid != null "> and patientid = #{patientid}</if>
@@ -55,7 +55,6 @@
             <if test="relationid != null "> and relationid = #{relationid}</if>
             <if test="isupload != null "> and isupload = #{isupload}</if>
             <if test="uploadTime != null "> and upload_time = #{uploadTime}</if>
-        </where>
     </select>
 
     <select id="selectSchemePlanById" parameterType="Long" resultMap="SchemePlanResult">
diff --git a/smartor/src/main/resources/mapper/smartor/SchemeTaskMapper.xml b/smartor/src/main/resources/mapper/smartor/SchemeTaskMapper.xml
index f978172..a9debc3 100644
--- a/smartor/src/main/resources/mapper/smartor/SchemeTaskMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/SchemeTaskMapper.xml
@@ -61,7 +61,7 @@
 
     <select id="selectSchemeTaskList" parameterType="SchemeTask" resultMap="SchemeTaskResult">
         <include refid="selectSchemeTaskVo"/>
-        <where>
+        where 1=1
             <if test="schemeid != null "> and schemeid = #{schemeid}</if>
             <if test="schemeplanid != null "> and schemeplanid = #{schemeplanid}</if>
             <if test="patientid != null "> and patientid = #{patientid}</if>
@@ -103,7 +103,6 @@
             <if test="ismanual != null "> and ismanual = #{ismanual}</if>
             <if test="losstime != null "> and losstime = #{losstime}</if>
             <if test="relationlistid != null  and relationlistid != ''"> and relationlistid = #{relationlistid}</if>
-        </where>
     </select>
 
     <select id="selectSchemeTaskById" parameterType="Long" resultMap="SchemeTaskResult">
diff --git a/smartor/src/main/resources/mapper/smartor/SchemeTaskconfigMapper.xml b/smartor/src/main/resources/mapper/smartor/SchemeTaskconfigMapper.xml
index 00ce0bd..c699e5c 100644
--- a/smartor/src/main/resources/mapper/smartor/SchemeTaskconfigMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/SchemeTaskconfigMapper.xml
@@ -63,7 +63,7 @@
 
     <select id="selectSchemeTaskconfigList" parameterType="SchemeTaskconfig" resultMap="SchemeTaskconfigResult">
         <include refid="selectSchemeTaskconfigVo"/>
-        <where>
+        where 1=1
             <if test="schemeid != null "> and schemeid = #{schemeid}</if>
             <if test="triggersceneid != null "> and triggersceneid = #{triggersceneid}</if>
             <if test="triggerruleid != null "> and triggerruleid = #{triggerruleid}</if>
@@ -107,7 +107,6 @@
             <if test="relationlistid != null  and relationlistid != ''"> and relationlistid = #{relationlistid}</if>
             <if test="relationcode != null  and relationcode != ''"> and relationcode = #{relationcode}</if>
             <if test="isrepeat != null "> and isrepeat = #{isrepeat}</if>
-        </where>
     </select>
 
     <select id="selectSchemeTaskconfigById" parameterType="Long" resultMap="SchemeTaskconfigResult">
diff --git a/smartor/src/main/resources/mapper/smartor/SchemeTaskrecordCalldetailMapper.xml b/smartor/src/main/resources/mapper/smartor/SchemeTaskrecordCalldetailMapper.xml
index da67945..b76b631 100644
--- a/smartor/src/main/resources/mapper/smartor/SchemeTaskrecordCalldetailMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/SchemeTaskrecordCalldetailMapper.xml
@@ -51,7 +51,7 @@
 
     <select id="selectSchemeTaskrecordCalldetailList" parameterType="SchemeTaskrecordCalldetail" resultMap="SchemeTaskrecordCalldetailResult">
         <include refid="selectSchemeTaskrecordCalldetailVo"/>
-        <where>
+        where 1=1
             <if test="uuid != null  and uuid != ''"> and uuid = #{uuid}</if>
             <if test="phone != null  and phone != ''"> and phone = #{phone}</if>
             <if test="operate != null  and operate != ''"> and operate = #{operate}</if>
@@ -83,7 +83,6 @@
             <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>
-        </where>
     </select>
 
     <select id="selectSchemeTaskrecordCalldetailById" parameterType="Long" resultMap="SchemeTaskrecordCalldetailResult">
diff --git a/smartor/src/main/resources/mapper/smartor/SchemeTaskrecordMapper.xml b/smartor/src/main/resources/mapper/smartor/SchemeTaskrecordMapper.xml
index cf44ccc..6917fe7 100644
--- a/smartor/src/main/resources/mapper/smartor/SchemeTaskrecordMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/SchemeTaskrecordMapper.xml
@@ -41,7 +41,7 @@
 
     <select id="selectSchemeTaskrecordList" parameterType="SchemeTaskrecord" resultMap="SchemeTaskrecordResult">
         <include refid="selectSchemeTaskrecordVo"/>
-        <where>
+        where 1=1
             <if test="recordtype != null "> and recordtype = #{recordtype}</if>
             <if test="taskid != null "> and taskid = #{taskid}</if>
             <if test="result != null  and result != ''"> and result = #{result}</if>
@@ -63,7 +63,6 @@
             <if test="seatsid != null "> and seatsid = #{seatsid}</if>
             <if test="handletype != null "> and handletype = #{handletype}</if>
             <if test="guid != null "> and guid = #{guid}</if>
-        </where>
     </select>
 
     <select id="selectSchemeTaskrecordById" parameterType="Long" resultMap="SchemeTaskrecordResult">
diff --git a/smartor/src/main/resources/mapper/smartor/SchemeTaskrepeatconfigMapper.xml b/smartor/src/main/resources/mapper/smartor/SchemeTaskrepeatconfigMapper.xml
index acb025a..ccb309a 100644
--- a/smartor/src/main/resources/mapper/smartor/SchemeTaskrepeatconfigMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/SchemeTaskrepeatconfigMapper.xml
@@ -36,7 +36,7 @@
 
     <select id="selectSchemeTaskrepeatconfigList" parameterType="SchemeTaskrepeatconfig" resultMap="SchemeTaskrepeatconfigResult">
         <include refid="selectSchemeTaskrepeatconfigVo"/>
-        <where>
+        where 1=1
             <if test="schemeid != null "> and schemeid = #{schemeid}</if>
             <if test="triggersceneid != null "> and triggersceneid = #{triggersceneid}</if>
             <if test="triggerruleid != null "> and triggerruleid = #{triggerruleid}</if>
@@ -53,7 +53,6 @@
             <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>
-        </where>
     </select>
 
     <select id="selectSchemeTaskrepeatconfigById" parameterType="Long" resultMap="SchemeTaskrepeatconfigResult">
diff --git a/smartor/src/main/resources/mapper/smartor/SchemeTriggerruleMapper.xml b/smartor/src/main/resources/mapper/smartor/SchemeTriggerruleMapper.xml
index c55a7c3..b2b30bd 100644
--- a/smartor/src/main/resources/mapper/smartor/SchemeTriggerruleMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/SchemeTriggerruleMapper.xml
@@ -63,7 +63,7 @@
 
     <select id="selectSchemeTriggerruleList" parameterType="SchemeTriggerrule" resultMap="SchemeTriggerruleResult">
         <include refid="selectSchemeTriggerruleVo"/>
-        <where>
+        where 1=1
             <if test="conditionstype != null ">and conditionstype = #{conditionstype}</if>
             <if test="orand != null ">and orand = #{orand}</if>
             <if test="ruleconditions != null  and ruleconditions != ''">and ruleconditions = #{ruleconditions}</if>
@@ -88,7 +88,6 @@
             <if test="groupnumber != null ">and groupnumber = #{groupnumber}</if>
             <if test="grouporand != null ">and grouporand = #{grouporand}</if>
             <if test="isrequired != null ">and isrequired = #{isrequired}</if>
-        </where>
     </select>
 
     <select id="selectSchemeTriggerruleById" parameterType="Long" resultMap="SchemeTriggerruleResult">
diff --git a/smartor/src/main/resources/mapper/smartor/SchemeTriggersceneMapper.xml b/smartor/src/main/resources/mapper/smartor/SchemeTriggersceneMapper.xml
index a8ba07a..9a3e04d 100644
--- a/smartor/src/main/resources/mapper/smartor/SchemeTriggersceneMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/SchemeTriggersceneMapper.xml
@@ -41,7 +41,7 @@
 
     <select id="selectSchemeTriggersceneList" parameterType="SchemeTriggerscene" resultMap="SchemeTriggersceneResult">
         <include refid="selectSchemeTriggersceneVo"/>
-        <where>
+        where 1=1
             <if test="schemeid != null ">and schemeid = #{schemeid}</if>
             <if test="baselinetime != null ">and baselinetime = #{baselinetime}</if>
             <if test="triggerornot != null ">and triggerornot = #{triggerornot}</if>
@@ -49,7 +49,6 @@
             <if test="isupload != null ">and isupload = #{isupload}</if>
             <if test="uploadTime != null ">and upload_time = #{uploadTime}</if>
             <if test="ismain != null ">and ismain = #{ismain}</if>
-        </where>
     </select>
 
     <select id="selectSchemeTriggersceneById" parameterType="Long" resultMap="SchemeTriggersceneResult">
diff --git a/smartor/src/main/resources/mapper/smartor/ServiceCheckMapper.xml b/smartor/src/main/resources/mapper/smartor/ServiceCheckMapper.xml
index 69f0e5b..aa97003 100644
--- a/smartor/src/main/resources/mapper/smartor/ServiceCheckMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/ServiceCheckMapper.xml
@@ -30,8 +30,8 @@
     <select id="selectServiceCheckList" parameterType="com.smartor.domain.ServiceCheck"
             resultMap="ServiceCheckResult">
         <include refid="selectServiceCheckVo"/>
-        <where>
-            del_flag=0
+        where 1=1
+            and del_flag = 0
             <if test="deptCode != null  and deptCode != ''">
                 and dept_code = #{deptCode}
             </if>
@@ -44,7 +44,6 @@
             <if test="orgid != null  and orgid != ''">
                 and orgid = #{orgid}
             </if>
-        </where>
     </select>
 
     <select id="selectServiceCheckById" parameterType="Long"
diff --git a/smartor/src/main/resources/mapper/smartor/ServiceOutPathMapper.xml b/smartor/src/main/resources/mapper/smartor/ServiceOutPathMapper.xml
index 54cb39c..45f96c6 100644
--- a/smartor/src/main/resources/mapper/smartor/ServiceOutPathMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/ServiceOutPathMapper.xml
@@ -36,8 +36,8 @@
     <select id="selectServiceOutPathList" parameterType="com.smartor.domain.ServiceOutPath"
             resultMap="ServiceOutPathResult">
         <include refid="selectServiceOutPathVo"/>
-        <where>
-            del_flag=0
+        where 1=1
+            and del_flag = 0
             and orgid is null
             <if test="param1 != null ">
                 and param1 = #{param1}
@@ -58,7 +58,6 @@
                 and radix=#{radix}
             </if>
 
-        </where>
     </select>
 
     <select id="selectServiceOutPathById" parameterType="Long"
diff --git a/smartor/src/main/resources/mapper/smartor/ServicePatientTempMapper.xml b/smartor/src/main/resources/mapper/smartor/ServicePatientTempMapper.xml
index 749d101..6dd0733 100644
--- a/smartor/src/main/resources/mapper/smartor/ServicePatientTempMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/ServicePatientTempMapper.xml
@@ -38,7 +38,7 @@
     <select id="selectServicePatientTempList" parameterType="com.smartor.domain.ServicePatientTemp"
             resultMap="ServicePatientTempResult">
         <include refid="selectServicePatientTempVo"/>
-        <where>
+        where 1=1
             <if test="userId != null ">
                 and user_id = #{userId}
             </if>
@@ -60,7 +60,6 @@
             <if test="orgid != null ">
                 and orgid = #{orgid}
             </if>
-        </where>
     </select>
 
     <select id="selectServicePatientTempById" parameterType="Long"
diff --git a/smartor/src/main/resources/mapper/smartor/ServiceSubtaskAnswerMapper.xml b/smartor/src/main/resources/mapper/smartor/ServiceSubtaskAnswerMapper.xml
index 9194230..079dfcd 100644
--- a/smartor/src/main/resources/mapper/smartor/ServiceSubtaskAnswerMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/ServiceSubtaskAnswerMapper.xml
@@ -52,7 +52,7 @@
     <select id="selectServiceSubtaskAnswerList" parameterType="com.smartor.domain.ServiceSubtaskAnswer"
             resultMap="ServiceSubtaskAnswerResult">
         <include refid="selectServiceSubtaskAnswerVo"/>
-        <where>
+        where 1=1
             <if test="taskid != null ">and taskid = #{taskid}</if>
             <if test="patId != null ">and pat_id = #{patId}</if>
             <if test="orgid != null ">and orgid = #{orgid}</if>
@@ -68,7 +68,6 @@
             <if test="pid != null  and pid != ''">and pid = #{pid}</if>
             <if test="guid != null  and guid != ''">and guid = #{guid}</if>
             <if test="answerps != null  and answerps != ''">and answerps = #{answerps}</if>
-        </where>
     </select>
 
     <select id="selectServiceSubtaskAnswerById" parameterType="Long" resultMap="ServiceSubtaskAnswerResult">
diff --git a/smartor/src/main/resources/mapper/smartor/ServiceSubtaskDetailMapper.xml b/smartor/src/main/resources/mapper/smartor/ServiceSubtaskDetailMapper.xml
index dd283ea..cef69bb 100644
--- a/smartor/src/main/resources/mapper/smartor/ServiceSubtaskDetailMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/ServiceSubtaskDetailMapper.xml
@@ -120,7 +120,7 @@
     <select id="selectServiceSubtaskDetailList" parameterType="com.smartor.domain.ServiceSubtaskDetail"
             resultMap="ServiceSubtaskDetailResult">
         <include refid="selectServiceSubtaskDetailVo"/>
-        <where>
+        where 1=1
             <if test="subId != null">and sub_id = #{subId}</if>
             <if test="targetid != null">and targetid = #{targetid}</if>
             <if test="extemplateText != null">and extemplate_text = #{extemplateText}</if>
@@ -166,7 +166,6 @@
             <if test="comment != null  and comment != ''">and comment = #{comment}</if>
             <if test="scriptid != null ">and scriptid = #{scriptid}</if>
             <if test=" patid != null">and patid = #{patid}</if>
-        </where>
     </select>
 
     <select id="selectServiceSubtaskDetailByCalldetailid" parameterType="String" resultMap="ServiceSubtaskDetailResult">
diff --git a/smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml b/smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml
index fe4f4ed..64351d6 100644
--- a/smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml
@@ -208,34 +208,37 @@
 
     <select id="selectServiceSubtaskBySendstate" parameterType="com.smartor.domain.ServiceSubtaskVO"
             resultMap="ServiceSubtaskResult">
-
         <include refid="selectServiceSubtaskVo"/>
-        <where>
-            del_flag=0
-            <if test="taskid != null ">and taskid = #{taskid}</if>
-            <if test="serviceType != null ">and service_type = #{serviceType}</if>
-            <if test="patid != null ">and patid = #{patid}</if>
-            <if test="sendstates!=null">
-                AND sendstate IN
-                <foreach collection="sendstates" item="sendstate" open="(" separator=","
-                         close=")">
-                    #{sendstate}
-                </foreach>
-            </if>
-        </where>
+        where 1=1
+        and del_flag = 0
+        <if test="orgid != null and orgid != ''">
+            and orgid = #{orgid}
+        </if>
+        <if test="taskid != null ">and taskid = #{taskid}</if>
+        <if test="serviceType != null ">and service_type = #{serviceType}</if>
+        <if test="patid != null ">and patid = #{patid}</if>
+        <if test="sendstates!=null">
+            AND sendstate IN
+            <foreach collection="sendstates" item="sendstate" open="(" separator=","
+                     close=")">
+                #{sendstate}
+            </foreach>
+        </if>
     </select>
 
     <select id="queryServiceSubtaskList" parameterType="com.smartor.domain.ServiceSubtaskVO"
             resultMap="ServiceSubtaskResult">
         <include refid="selectServiceSubtaskVo"/>
-        <where>
-            del_flag=0
+        where 1=1
+            and del_flag = 0
+            <if test="orgid != null and orgid != ''">
+                and orgid = #{orgid}
+            </if>
             <if test="taskid != null ">and taskid = #{taskid}</if>
             <if test="visitTime != null">
                 AND date_format(visit_time,'%y%m%d') &lt;= date_format(#{visitTime},'%y%m%d')
             </if>
             <if test="sendstate != null ">and sendstate = #{sendstate}</if>
-        </where>
 
     </select>
 
@@ -243,8 +246,8 @@
     <select id="selectServiceSubtaskList" parameterType="com.smartor.domain.ServiceSubtaskVO"
             resultMap="ServiceSubtaskResult">
         <include refid="selectServiceSubtaskVo"/>
-        <where>
-            del_flag=0
+        where 1=1
+            and del_flag = 0
             <if test="sendname != null  and sendname != ''">and sendname like concat('%', #{sendname}, '%')</if>
             <if test="phone != null  and phone != ''">and phone = #{phone}</if>
             <if test="leavehospitaldistrictcode != null  and leavehospitaldistrictcode != ''">and
@@ -396,7 +399,6 @@
                     #{visitDeptCodes}
                 </foreach>
             </if>
-        </where>
         <if test="sort != null  and sort==0">order by endtime asc</if>
         <if test="sort != null  and sort==1">order by endtime desc</if>
         <if test="sort != null  and sort==2">order by long_send_time asc</if>
@@ -411,22 +413,25 @@
     <select id="getCompensateServiceSubtaskList" parameterType="com.smartor.domain.ServiceSubtaskVO"
             resultMap="ServiceSubtaskResult">
         <include refid="selectServiceSubtaskVo"/>
-        <where>
-            del_flag=0
+        where 1=1
+            and del_flag = 0
+            <if test="orgid != null and orgid != ''">
+                and orgid = #{orgid}
+            </if>
             <if test="visitTime != null">
                 AND date_format(visit_time,'%y%m%d') &lt;= date_format(#{visitTime},'%y%m%d')
             </if>
             <if test="sendstate != null ">and sendstate = #{sendstate}</if>
-
-        </where>
-
     </select>
 
     <select id="selectServiceSubtaskListByCreateTime" parameterType="com.smartor.domain.ServiceSubtaskVO"
             resultMap="ServiceSubtaskResult">
         <include refid="selectServiceSubtaskVo"/>
-        <where>
-            del_flag=0
+        where 1=1
+            and del_flag = 0
+            <if test="orgid != null and orgid != ''">
+                and orgid = #{orgid}
+            </if>
             <if test="createStartTime != null  and createEndTime != null">and create_time BETWEEN #{createStartTime} AND
                 #{createEndTime}
             </if>
@@ -443,7 +448,6 @@
             <if test="managementDoctor != null">and management_doctor = #{managementDoctor}</if>
             <if test="currentPreachform != null">and current_preachform = #{currentPreachform}</if>
             <if test="isabnormal != null">and isabnormal = #{isabnormal}</if>
-        </where>
 
     </select>
 
@@ -451,8 +455,8 @@
     <select id="selectServiceSubtaskListAgain" parameterType="com.smartor.domain.ServiceSubtaskVO"
             resultMap="ServiceSubtaskResult">
         <include refid="selectServiceSubtaskVo"/>
-        <where>
-            del_flag=0
+        where 1=1
+            and del_flag = 0
             and upid is not null
             and visit_count > 1
             <if test="createStartTime != null  and createEndTime != null">and create_time BETWEEN #{createStartTime} AND
@@ -501,7 +505,6 @@
             <if test="managementDoctorCode != null">and management_doctor_code = #{managementDoctorCode}</if>
             <if test="isabnormal != null">and isabnormal = #{isabnormal}</if>
             <if test="managementDoctor != null">and management_doctor like concat('%',#{managementDoctor}, '%')</if>
-        </where>
 
     </select>
 
@@ -509,13 +512,16 @@
         SELECT b.sendstate
         from service_task a
         JOIN service_subtask b on a.taskid = b.taskid and a.pat_cycle = 0 and b.del_flag = 0
-        <where>b.taskid = #{taskid}
+        where 1=1
+            and b.taskid = #{taskid}
             and b.patid = #{patid}
             <if test="createTime != null and createTime != ''">
                 DATE_FORMAT(b.create_time, '%Y-%m-%d') LIKE CONCAT(#{createTimeNew}, '%')
             </if>
             <if test="sendstate != null ">and b.sendstate = #{sendstate}</if>
-        </where>
+            <if test="orgid != null and orgid != ''">
+                and b.orgid = #{orgid}
+            </if>
     </select>
 
     <select id="selectTimelyRate" parameterType="com.smartor.domain.ServiceSubtask" resultType="double">
@@ -550,8 +556,8 @@
     <select id="selectTimelyRateDetail" parameterType="com.smartor.domain.ServiceSubtask"
             resultMap="ServiceSubtaskResult">
         <include refid="selectServiceSubtaskVo"/>
-        <where>
-            id in (
+        where 1=1
+            and id in (
             SELECT id FROM
             (SELECT id, visit_time, finishtime,
             (CASE WHEN ( DATE_FORMAT( visit_time, '%y%m%d' ) &lt; DATE_FORMAT( IF ( ISNULL( finishtime ), NOW(),
@@ -577,7 +583,6 @@
             <if test="managementDoctorCode != null">and management_doctor_code = #{managementDoctorCode}</if>
             <if test="managementDoctor != null">and management_doctor like concat('%',#{managementDoctor}, '%')</if>
             ) a where a.finished =1)
-        </where>
     </select>
 
     <select id="selectServiceSubtaskById" parameterType="Long" resultMap="ServiceSubtaskResult">
@@ -957,10 +962,12 @@
             <if test="taskSituation != null">task_situation=#{taskSituation},</if>
             <if test="isabnormal != null">isabnormal=#{isabnormal},</if>
         </trim>
-        <where>
+        where 1=1
             <if test="patid != null ">and patid = #{patid}</if>
             <if test="taskid != null ">and taskid = #{taskid}</if>
-        </where>
+            <if test="orgid != null and orgid != ''">
+                and orgid = #{orgid}
+            </if>
     </update>
 
     <update id="updateServiceSubtaskByCondition" parameterType="com.smartor.domain.ServiceSubtask">
@@ -1165,8 +1172,11 @@
     <select id="getSfStatistics" parameterType="com.smartor.domain.ServiceSubtaskCountReq"
             resultMap="ServiceSubtaskResult">
         <include refid="selectServiceSubtaskVo"/>
-        <where>
-            del_flag=0
+        where 1=1
+            and del_flag = 0
+            <if test="orgid != null and orgid != ''">
+                and orgid = #{orgid}
+            </if>
             <if test="leavehospitaldistrictcodes != null and leavehospitaldistrictcodes.size() > 0">
                 AND leavehospitaldistrictcode IN
                 <foreach collection="leavehospitaldistrictcodes" item="leavehospitaldistrictcode" open="(" separator=","
@@ -1195,7 +1205,6 @@
             <if test="visitDeptCode != null">and visit_dept_code = #{visitDeptCode}</if>
             <if test="visitDeptName != null">abd visit_dept_name = #{visitDeptName}</if>
             <if test="isabnormal != null">abd isabnormal = #{isabnormal}</if>
-        </where>
     </select>
 
     <select id="getSfStatisticsJoy" parameterType="com.smartor.domain.ServiceSubtaskCountReq"
@@ -1205,8 +1214,11 @@
         config_key='joyCount')) joyAllCount
         FROM service_subtask_detail a
         WHERE sub_id IN(SELECT id FROM service_subtask t
-        <where>
-            del_flag=0
+        where 1=1
+            and del_flag = 0
+            <if test="orgid != null and orgid != ''">
+                and orgid = #{orgid}
+            </if>
             <if test="leavehospitaldistrictcodes != null and leavehospitaldistrictcodes.size() > 0">
                 AND leavehospitaldistrictcode IN
                 <foreach collection="leavehospitaldistrictcodes" item="leavehospitaldistrictcode" open="(" separator=","
@@ -1233,9 +1245,8 @@
                 AND date_format(visit_time,'%y%m%d') &lt;= date_format(#{endTime},'%y%m%d')
             </if>
             <if test="visitDeptCode != null">and visit_dept_code = #{visitDeptCode}</if>
-            <if test="visitDeptName != null">abd visit_dept_name = #{visitDeptName}</if>
-            <if test="isabnormal != null">abd isabnormal = #{isabnormal}</if>
-        </where>
+            <if test="visitDeptName != null">and visit_dept_name = #{visitDeptName}</if>
+            <if test="isabnormal != null">and isabnormal = #{isabnormal}</if>
         )
         AND targetid IN ( SELECT id FROM ivr_liba_target WHERE assortid IN (SELECT config_value FROM sys_config WHERE
         config_key='joyCount'))
@@ -1247,8 +1258,11 @@
         SELECT joyName,joyCount,joyAllCount,ROUND(joyCount/joyAllCount,2) joyTotal FROM (
         SELECT targetname joyName,
         (select COUNT(sub_id) FROM service_subtask_detail WHERE sub_id IN(SELECT id FROM service_subtask t
-        <where>
-            del_flag=0
+        where 1=1
+            and del_flag = 0
+            <if test="orgid != null and orgid != ''">
+                and orgid = #{orgid}
+            </if>
             <if test="leavehospitaldistrictcodes != null and leavehospitaldistrictcodes.size() > 0">
                 AND leavehospitaldistrictcode IN
                 <foreach collection="leavehospitaldistrictcodes" item="leavehospitaldistrictcode" open="(" separator=","
@@ -1274,11 +1288,13 @@
                 AND date_format(visit_time,'%y%m%d') >= date_format(#{startTime},'%y%m%d')
                 AND date_format(visit_time,'%y%m%d') &lt;= date_format(#{endTime},'%y%m%d')
             </if>
-        </where>
         ) AND targetid=a.id) joyCount , (SELECT COUNT(*) from (select sub_id FROM service_subtask_detail
         WHERE sub_id IN(SELECT id FROM service_subtask t
-        <where>
-            del_flag=0
+        where 1=1
+            and del_flag = 0
+            <if test="orgid != null and orgid != ''">
+                and orgid = #{orgid}
+            </if>
             <if test="leavehospitaldistrictcodes != null and leavehospitaldistrictcodes.size() > 0">AND
                 leavehospitaldistrictcode IN
                 <foreach
@@ -1305,7 +1321,6 @@
                 AND date_format(visit_time,'%y%m%d') >= date_format(#{startTime},'%y%m%d')
                 AND date_format(visit_time,'%y%m%d') &lt;= date_format(#{endTime},'%y%m%d')
             </if>
-        </where>
         GROUP BY sub_id ) ) ta ) joyAllCount
         FROM ivr_liba_target a
         WHERE assortid IN (SELECT config_value FROM sys_config WHERE config_key=
@@ -1323,9 +1338,12 @@
         COUNT(sub_id) joyCount
         FROM service_subtask_detail a
         INNER JOIN service_subtask t ON a.sub_id = t.id
-        <where>
-            a.del_flag=0
+        where 1=1
+            and a.del_flag=0
             AND t.del_flag=0
+            <if test="orgid != null and orgid != ''">
+                and a.orgid = #{orgid}
+            </if>
             <if test="leavehospitaldistrictcodes != null and leavehospitaldistrictcodes.size() > 0">
                 AND t.leavehospitaldistrictcode IN
                 <foreach collection="leavehospitaldistrictcodes" item="leavehospitaldistrictcode" open="(" separator=","
@@ -1364,7 +1382,6 @@
             <if test="type != null">
                 and t.type = #{type}
             </if>
-        </where>
         GROUP BY a.sub_id
     </select>
 
@@ -1448,8 +1465,11 @@
         FROM
         service_subtask_detail ssd
         INNER JOIN service_subtask ss ON ssd.sub_id = ss.id
-        <where>
-            ss.del_flag=0
+        where 1=1
+            and ss.del_flag=0
+            <if test="orgid != null and orgid != ''">
+                and ss.orgid = #{orgid}
+            </if>
             AND IFNULL(ssd.matchedtext,ssd.asrtext) IS NOT NULL
             AND IFNULL(ssd.matchedtext,ssd.asrtext) != ''
             <if test="leavehospitaldistrictcodes != null and leavehospitaldistrictcodes.size() > 0">
@@ -1484,7 +1504,6 @@
             <if test="configValue != null and configValue != ''">
                 AND ssd.categoryid IN (${configValue})
             </if>
-        </where>
         group by ssd.scriptid, IFNULL(ssd.matchedtext,ssd.asrtext)
     </select>
 
@@ -1841,8 +1860,8 @@
         SUM(CASE WHEN sendstate = 1 THEN 1 ELSE 0 END) AS blq,
         SUM(CASE WHEN excep IS NOT NULL AND excep != '0' THEN 1 ELSE 0 END) AS yc
         FROM service_subtask
-        <where>
-            del_flag = 0
+        where 1=1
+            and del_flag = 0
             <if test="sendname != null and sendname != ''">
                 AND sendname LIKE CONCAT('%', #{sendname}, '%')
             </if>
@@ -2000,7 +2019,6 @@
             <if test="visitCount != null and visitCount > 1">
                 AND visit_count > 1
             </if>
-        </where>
     </select>
 
 </mapper>
diff --git a/smartor/src/main/resources/mapper/smartor/ServiceSubtaskPreachformMapper.xml b/smartor/src/main/resources/mapper/smartor/ServiceSubtaskPreachformMapper.xml
index 26e3ff8..50e4d92 100644
--- a/smartor/src/main/resources/mapper/smartor/ServiceSubtaskPreachformMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/ServiceSubtaskPreachformMapper.xml
@@ -42,8 +42,8 @@
     <select id="selectServiceSubtaskPreachformList" parameterType="com.smartor.domain.ServiceSubtaskPreachform"
             resultMap="ServiceSubtaskPreachformResult">
         <include refid="selectServiceSubtaskPreachformVo"/>
-        <where>
-            del_flag=0
+        where 1=1
+            and del_flag = 0
             <if test="subid != null ">
                 and subid = #{subid}
             </if>
@@ -65,7 +65,6 @@
             <if test="compensateTime != null ">
                 and compensate_time = #{compensateTime}
             </if>
-        </where>
     </select>
 
     <select id="selectServiceSubtaskPreachformById" parameterType="Long"
@@ -229,23 +228,22 @@
                 #{compensateTime},
             </if>
         </trim>
-        <where>
-            <if test="subid != null">subid =
+        where 1=1
+            <if test="subid != null">and subid =
                 #{subid},
             </if>
-            <if test="taskid != null">taskid =
+            <if test="taskid != null">and taskid =
                 #{taskid},
             </if>
-            <if test="preachform != null">preachform =
+            <if test="preachform != null">and preachform =
                 #{preachform},
             </if>
-            <if test="remark != null">remark =
+            <if test="remark != null">and remark =
                 #{remark},
             </if>
-            <if test="orgid != null">orgid =
+            <if test="orgid != null">and orgid =
                 #{orgid},
             </if>
-        </where>
     </update>
 
 
diff --git a/smartor/src/main/resources/mapper/smartor/ServiceSubtaskRecordMapper.xml b/smartor/src/main/resources/mapper/smartor/ServiceSubtaskRecordMapper.xml
index 2a72f0d..b4a019e 100644
--- a/smartor/src/main/resources/mapper/smartor/ServiceSubtaskRecordMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/ServiceSubtaskRecordMapper.xml
@@ -56,7 +56,7 @@
     <select id="selectServiceSubtaskRecordList" parameterType="com.smartor.domain.ServiceSubtaskRecord"
             resultMap="ServiceSubtaskRecordResult">
         <include refid="selectServiceSubtaskRecordVo"/>
-        <where>
+        where 1=1
             <if test="taskid != null  and taskid != ''">and taskid = #{taskid}</if>
             <if test="subtaskId != null ">and subtask_id = #{subtaskId}</if>
             <if test="uuid != null  and uuid != ''">and uuid = #{uuid}</if>
@@ -72,7 +72,6 @@
             <if test="pid != null ">and pid = #{pid}</if>
             <if test="guid != null  and guid != ''">and guid = #{guid}</if>
             <if test="remark != null  and remark != ''">and remark = #{remark}</if>
-        </where>
     </select>
 
     <select id="selectServiceSubtaskRecordById" parameterType="Long" resultMap="ServiceSubtaskRecordResult">
diff --git a/smartor/src/main/resources/mapper/smartor/ServiceTaskMapper.xml b/smartor/src/main/resources/mapper/smartor/ServiceTaskMapper.xml
index f1bca5b..1e427e6 100644
--- a/smartor/src/main/resources/mapper/smartor/ServiceTaskMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/ServiceTaskMapper.xml
@@ -122,8 +122,8 @@
 
     <select id="selectServiceTaskList" parameterType="com.smartor.domain.ServiceTask" resultMap="ServiceTaskResult">
         <include refid="selectServiceTaskVo"/>
-        <where>
-            del_flag=0
+        where 1=1
+            and del_flag = 0
             <if test="taskName != null  and taskName != ''">and task_name like concat('%', #{taskName}, '%')</if>
             <if test="taskid != null">and taskid = #{taskid}</if>
             <if test="sendTimeSlot != null  and sendTimeSlot != ''">and send_time_slot like concat('%', #{sendTimeSlot},
@@ -191,7 +191,6 @@
                     #{leaveldeptcode}
                 </foreach>
             </if>
-        </where>
         order by update_time desc,taskid desc
     </select>
 
@@ -251,19 +250,18 @@
         service_task.nexttaskid,
         service_task.nexttaskname,
         service_task.orgid from service_task
-        <where>
-            service_task.del_flag=0
+        where 1=1
+            and service_task.del_flag = 0
             <!--            and taskid in (-->
             <!--            select task_id from service_taskdept-->
-            <!--            <where>-->
+            <!--            where 1=1-->
             <!--                <if test="leaveldeptcodes != null and leaveldeptcodes.size()>0">-->
-            <!--                    dept_code in-->
+            <!--                    and dept_code in-->
             <!--                    <foreach collection="leaveldeptcodes" item="leaveldeptcode" open="(" separator=","-->
             <!--                             close=")">-->
             <!--                        #{leaveldeptcode}-->
             <!--                    </foreach>-->
             <!--                </if>-->
-            <!--            </where>-->
             <!--            )-->
             <if test="taskName != null  and taskName != ''">and service_task.task_name like concat('%', #{taskName},
                 '%')
@@ -328,8 +326,6 @@
             <if test="leavehospitaldistrictcode != null  ">and service_task.leavehospitaldistrictcode =
                 #{leavehospitaldistrictcode}
             </if>
-
-        </where>
         order by update_time desc,taskid desc
     </select>
 
diff --git a/smartor/src/main/resources/mapper/smartor/ServiceTaskdeptMapper.xml b/smartor/src/main/resources/mapper/smartor/ServiceTaskdeptMapper.xml
index a858e13..e4c295e 100644
--- a/smartor/src/main/resources/mapper/smartor/ServiceTaskdeptMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/ServiceTaskdeptMapper.xml
@@ -40,8 +40,8 @@
     <select id="selectServiceTaskdeptList" parameterType="com.smartor.domain.ServiceTaskdept"
             resultMap="ServiceTaskdeptResult">
         <include refid="selectServiceTaskdeptVo"/>
-        <where>
-            del_flag=0
+        where 1=1
+            and del_flag = 0
             <if test="taskId != null ">
                 and task_id = #{taskId}
             </if>
@@ -69,7 +69,6 @@
             <if test="orgid != null  and orgid != ''">
                 and orgid = #{orgid}
             </if>
-        </where>
     </select>
 
     <select id="selectServiceTaskdeptById" parameterType="Long"
@@ -172,10 +171,12 @@
             <if test="orgid != null">orgid = #{orgid},
             </if>
         </trim>
-        <where>
+        where 1=1
         <if test="id != null">and id = #{id}</if>
         <if test="taskId != null">and task_id = #{taskId}</if>
-        </where>
+        <if test="orgid != null and orgid != ''">
+            AND orgid = #{orgid}
+        </if>
     </update>
 
     <update id="deleteServiceTaskdeptById" parameterType="Long">
@@ -192,10 +193,12 @@
             del_flag =1,
             update_time = sysdate()
         </trim>
-        <where>
+        where 1=1
             <if test="id != null">and id = #{id}</if>
             <if test="taskId != null">and task_id = #{taskId}</if>
-        </where>
+            <if test="orgid != null and orgid != ''">
+                AND orgid = #{orgid}
+            </if>
     </update>
 
     <update id="deleteServiceTaskdeptByIds" parameterType="String">
diff --git a/smartor/src/main/resources/mapper/smartor/ServiceTaskdiagMapper.xml b/smartor/src/main/resources/mapper/smartor/ServiceTaskdiagMapper.xml
index 6892c29..00fb720 100644
--- a/smartor/src/main/resources/mapper/smartor/ServiceTaskdiagMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/ServiceTaskdiagMapper.xml
@@ -44,8 +44,8 @@
     <select id="selectServiceTaskdiagList" parameterType="com.smartor.domain.ServiceTaskdiag"
             resultMap="ServiceTaskdiagResult">
         <include refid="selectServiceTaskdiagVo"/>
-        <where>
-            del_flag=0
+        where 1=1
+            and del_flag = 0
             <if test="taskId != null ">
                 and task_id = #{taskId}
             </if>
@@ -79,7 +79,6 @@
             <if test="pid != null ">
                 and pid = #{pid}
             </if>
-        </where>
     </select>
 
     <select id="selectServiceTaskdiagById" parameterType="Long"
diff --git a/smartor/src/main/resources/mapper/smartor/ServiceTaskoperMapper.xml b/smartor/src/main/resources/mapper/smartor/ServiceTaskoperMapper.xml
index 16c8a2f..4caa261 100644
--- a/smartor/src/main/resources/mapper/smartor/ServiceTaskoperMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/ServiceTaskoperMapper.xml
@@ -44,8 +44,8 @@
     <select id="selectServiceTaskoperList" parameterType="com.smartor.domain.ServiceTaskoper"
             resultMap="ServiceTaskoperResult">
         <include refid="selectServiceTaskoperVo"/>
-        <where>
-            del_flag=0
+        where 1=1
+            and del_flag = 0
             <if test="taskId != null ">
                 and task_id = #{taskId}
             </if>
@@ -79,7 +79,6 @@
             <if test="pid != null ">
                 and pid = #{pid}
             </if>
-        </where>
     </select>
 
     <select id="selectServiceTaskoperById" parameterType="Long"
diff --git a/smartor/src/main/resources/mapper/smartor/ServiceThirdDataMapper.xml b/smartor/src/main/resources/mapper/smartor/ServiceThirdDataMapper.xml
index cc22d96..ecb65dd 100644
--- a/smartor/src/main/resources/mapper/smartor/ServiceThirdDataMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/ServiceThirdDataMapper.xml
@@ -35,7 +35,7 @@
     <select id="selectServiceThirdDataList" parameterType="com.smartor.domain.ServiceThirdData"
             resultMap="ServiceThirdDataResult">
         <include refid="selectServiceThirdDataVo"/>
-        <where>
+        where 1=1
             <if test="dataType != null  and dataType != ''">and data_type = #{dataType}</if>
             <if test="dataTypeExplain != null  and dataTypeExplain != ''">and data_type_explain = #{dataTypeExplain}
             </if>
@@ -44,7 +44,6 @@
             <if test="isDeal != null">and is_deal = #{isDeal}</if>
             <if test="orgid != null">and orgid = #{orgid}</if>
             <if test="createTime != null ">and create_time &lt;= #{createTime}</if>
-        </where>
     </select>
 
     <insert id="insertThirdData" parameterType="com.smartor.domain.ServiceThirdData">
diff --git a/smartor/src/main/resources/mapper/smartor/SvyCategoryMapper.xml b/smartor/src/main/resources/mapper/smartor/SvyCategoryMapper.xml
index 4b1a2da..54cbaa0 100644
--- a/smartor/src/main/resources/mapper/smartor/SvyCategoryMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/SvyCategoryMapper.xml
@@ -37,12 +37,11 @@
 
     <select id="selectSvyCategoryList" parameterType="com.smartor.domain.SvyCategory" resultMap="SvyCategoryResult">
         <include refid="selectSvyCategoryVo"/>
-        <where>
+        where 1=1
             <if test="categoryname != null  and categoryname != ''">and categoryname like concat('%', #{categoryname},
                 '%')
             </if>
             <if test="orgid != null  and orgid != ''">and orgid = #{orgid}</if>
-        </where>
     </select>
 
     <select id="selectSvyCategoryById" parameterType="String" resultType="com.smartor.domain.SvyCategory">
@@ -58,12 +57,14 @@
         a.upload_time,
         count(b.svyid) svyNum
         from svy_category a,svy_lib_title b
-        <where>
-            a.id = b.categoryid
+        where 1=1
+            and a.id = b.categoryid
+            <if test="orgid != null  and orgid != ''">
+                and a.orgid = #{orgid}
+            </if>
             <if test="categoryname != null and categoryname != ''">
                 and categoryname = #{categoryname}
             </if>
-        </where>
         group by a.categoryname
     </select>
 
diff --git a/smartor/src/main/resources/mapper/smartor/SvyFinishMapper.xml b/smartor/src/main/resources/mapper/smartor/SvyFinishMapper.xml
index 92552ff..b4c9371 100644
--- a/smartor/src/main/resources/mapper/smartor/SvyFinishMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/SvyFinishMapper.xml
@@ -33,12 +33,11 @@
 
     <select id="selectSvyFinishList" parameterType="SvyFinish" resultMap="SvyFinishResult">
         <include refid="selectSvyFinishVo"/>
-        <where>
+        where 1=1
             <if test="svytitle != null  and svytitle != ''"> and svytitle = #{svytitle}</if>
             <if test="totalscore != null "> and totalscore = #{totalscore}</if>
             <if test="orgid != null  and orgid != ''"> and orgid = #{orgid}</if>
             <if test="isabnormal != null "> and isabnormal = #{isabnormal}</if>
-        </where>
     </select>
 
     <select id="selectSvyFinishById" parameterType="Long" resultMap="SvyFinishResult">
diff --git a/smartor/src/main/resources/mapper/smartor/SvyFinishoptionMapper.xml b/smartor/src/main/resources/mapper/smartor/SvyFinishoptionMapper.xml
index cb89174..ceda1b5 100644
--- a/smartor/src/main/resources/mapper/smartor/SvyFinishoptionMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/SvyFinishoptionMapper.xml
@@ -29,12 +29,11 @@
 
     <select id="selectSvyFinishoptionList" parameterType="SvyFinishoption" resultMap="SvyFinishoptionResult">
         <include refid="selectSvyFinishoptionVo"/>
-        <where>
+        where 1=1
             <if test="psqoptionid != null "> and psqoptionid = #{psqoptionid}</if>
             <if test="content != null  and content != ''"> and content = #{content}</if>
             <if test="orgid != null  and orgid != ''"> and orgid = #{orgid}</if>
             <if test="isrobot != null "> and isrobot = #{isrobot}</if>
-        </where>
     </select>
 
     <select id="selectSvyFinishoptionById" parameterType="Long" resultMap="SvyFinishoptionResult">
diff --git a/smartor/src/main/resources/mapper/smartor/SvyFinishtopicMapper.xml b/smartor/src/main/resources/mapper/smartor/SvyFinishtopicMapper.xml
index 2ed6fa1..d4468a2 100644
--- a/smartor/src/main/resources/mapper/smartor/SvyFinishtopicMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/SvyFinishtopicMapper.xml
@@ -27,13 +27,12 @@
 
     <select id="selectSvyFinishtopicList" parameterType="SvyFinishtopic" resultMap="SvyFinishtopicResult">
         <include refid="selectSvyFinishtopicVo"/>
-        <where>
+        where 1=1
             <if test="topicid != null "> and topicid = #{topicid}</if>
             <if test="score != null "> and score = #{score}</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>
-        </where>
     </select>
 
     <select id="selectSvyFinishtopicById" parameterType="Long" resultMap="SvyFinishtopicResult">
diff --git a/smartor/src/main/resources/mapper/smartor/SvyLibExceptionMapper.xml b/smartor/src/main/resources/mapper/smartor/SvyLibExceptionMapper.xml
index 2809012..8b75cc9 100644
--- a/smartor/src/main/resources/mapper/smartor/SvyLibExceptionMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/SvyLibExceptionMapper.xml
@@ -35,7 +35,7 @@
 
     <select id="selectSvyLibExceptionList" parameterType="SvyLibException" resultMap="SvyLibExceptionResult">
         <include refid="selectSvyLibExceptionVo"/>
-        <where>
+        where 1=1
             <if test="oldid != null "> and oldid = #{oldid}</if>
             <if test="orgid != null  and orgid != ''"> and orgid = #{orgid}</if>
             <if test="questionoptionid != null "> and questionoptionid = #{questionoptionid}</if>
@@ -51,7 +51,6 @@
             <if test="istrack != null "> and istrack = #{istrack}</if>
             <if test="isupload != null "> and isupload = #{isupload}</if>
             <if test="uploadTime != null "> and upload_time = #{uploadTime}</if>
-        </where>
     </select>
 
     <select id="selectSvyLibExceptionByEcid" parameterType="Long" resultMap="SvyLibExceptionResult">
diff --git a/smartor/src/main/resources/mapper/smartor/SvyLibResultMapper.xml b/smartor/src/main/resources/mapper/smartor/SvyLibResultMapper.xml
index fa85ffc..7fa77b9 100644
--- a/smartor/src/main/resources/mapper/smartor/SvyLibResultMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/SvyLibResultMapper.xml
@@ -28,7 +28,7 @@
 
     <select id="selectSvyLibResultList" parameterType="SvyLibResult" resultMap="SvyLibResultResult">
         <include refid="selectSvyLibResultVo"/>
-        <where>
+        where 1=1
             <if test="svyid != null "> and svyid = #{svyid}</if>
             <if test="resultcontent != null  and resultcontent != ''"> and resultcontent = #{resultcontent}</if>
             <if test="orand != null "> and orand = #{orand}</if>
@@ -37,7 +37,6 @@
             <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>
-        </where>
     </select>
 
     <select id="selectSvyLibResultByResultid" parameterType="Long" resultMap="SvyLibResultResult">
diff --git a/smartor/src/main/resources/mapper/smartor/SvyLibScriptMapper.xml b/smartor/src/main/resources/mapper/smartor/SvyLibScriptMapper.xml
index 4749185..7d6488a 100644
--- a/smartor/src/main/resources/mapper/smartor/SvyLibScriptMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/SvyLibScriptMapper.xml
@@ -79,8 +79,8 @@
 
     <select id="selectSvyLibScriptList" parameterType="com.smartor.domain.SvyLibScript" resultMap="SvyLibScriptResult">
         <include refid="selectSvyLibScriptVo"/>
-        <where>
-            del_flag=0
+        where 1=1
+            and del_flag = 0
             <if test="id != null ">and id = #{id}</if>
             <if test="scriptType != null and scriptType != ''">and script_type = #{scriptType}</if>
             <if test="categoryid != null ">and categoryid = #{categoryid}</if>
@@ -101,7 +101,6 @@
             <if test="targetname != null  and targetname != ''">and targetname = #{targetname}</if>
             <if test="targettype != null  and targettype != ''">and targettype = #{targettype}</if>
             <if test="targetoptions != null  and targetoptions != ''">and targetoptions = #{targetoptions}</if>
-        </where>
         order by id desc
     </select>
 
diff --git a/smartor/src/main/resources/mapper/smartor/SvyLibScriptOptionMapper.xml b/smartor/src/main/resources/mapper/smartor/SvyLibScriptOptionMapper.xml
index d76942c..5e567db 100644
--- a/smartor/src/main/resources/mapper/smartor/SvyLibScriptOptionMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/SvyLibScriptOptionMapper.xml
@@ -84,8 +84,8 @@
     <select id="selectSvyLibScriptOptionList" parameterType="com.smartor.domain.SvyLibScriptOption"
             resultMap="SvyLibScriptOptionResult">
         <include refid="selectSvyLibScriptOptionVo"/>
-        <where>
-            del_flag=0
+        where 1=1
+            and del_flag = 0
             <if test="topicid != null ">and topicid = #{topicid}</if>
             <if test="svyid != null ">and svyid = #{svyid}</if>
             <if test="topictype != null ">and topictype = #{topictype}</if>
@@ -114,7 +114,6 @@
             <if test="appendflag != null">and appendflag = #{appendflag}</if>
             <if test="appenddesc != null">and appenddesc = #{appenddesc}</if>
             <if test="picturePath != null">and picture_path = #{picturePath}</if>
-        </where>
     </select>
 
     <select id="selectSvyLibScriptOptionByOptionid" parameterType="Long" resultMap="SvyLibScriptOptionResult">
diff --git a/smartor/src/main/resources/mapper/smartor/SvyLibScriptTagMapper.xml b/smartor/src/main/resources/mapper/smartor/SvyLibScriptTagMapper.xml
index 09f246f..824da96 100644
--- a/smartor/src/main/resources/mapper/smartor/SvyLibScriptTagMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/SvyLibScriptTagMapper.xml
@@ -44,8 +44,8 @@
     <select id="selectSvyLibScriptTagList" parameterType="com.smartor.domain.SvyLibScriptTag"
             resultMap="SvyLibScriptTagResult">
         <include refid="selectSvyLibScriptTagVo"/>
-        <where>
-            del_flag = 0
+        where 1=1
+            and del_flag = 0
             <if test="tagcategoryid != null ">and tagcategoryid = #{tagcategoryid}</if>
             <if test="scriptid != null ">and scriptid = #{scriptid}</if>
             <if test="tagid != null ">and tagid = #{tagid}</if>
@@ -55,7 +55,6 @@
             <if test="uploadTime != null ">and upload_time = #{uploadTime}</if>
             <if test="pid != null ">and pid = #{pid}</if>
             <if test="guid != null  and guid != ''">and guid = #{guid}</if>
-        </where>
     </select>
 
     <select id="selectSvyLibScriptTagById" parameterType="Long" resultMap="SvyLibScriptTagResult">
diff --git a/smartor/src/main/resources/mapper/smartor/SvyLibTemplageCategoryMapper.xml b/smartor/src/main/resources/mapper/smartor/SvyLibTemplageCategoryMapper.xml
index b0d9401..0e7b2c9 100644
--- a/smartor/src/main/resources/mapper/smartor/SvyLibTemplageCategoryMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/SvyLibTemplageCategoryMapper.xml
@@ -36,15 +36,14 @@
     <select id="selectSvyLibTemplateCategoryList" parameterType="com.smartor.domain.SvyLibTemplateCategory"
             resultMap="SvyLibTemplateCategoryResult">
         <include refid="selectSvyLibTemplateCategoryVo"/>
-        <where>
-            del_flag=0
+        where 1=1
+            and del_flag = 0
             <if test="name != null  and name != ''">and name like concat('%', #{name}, '%')</if>
             <if test="pid != null ">and pid = #{pid}</if>
             <if test="guid != null  and guid != ''">and guid = #{guid}</if>
             <if test="orgid != null ">and orgid = #{orgid}</if>
             <if test="seqno != null ">and seqno = #{seqno}</if>
 
-        </where>
     </select>
 
     <select id="selectSvyLibTemplateCategoryById" parameterType="Long" resultMap="SvyLibTemplateCategoryResult">
diff --git a/smartor/src/main/resources/mapper/smartor/SvyLibTemplateMapper.xml b/smartor/src/main/resources/mapper/smartor/SvyLibTemplateMapper.xml
index f7c88ce..9058c05 100644
--- a/smartor/src/main/resources/mapper/smartor/SvyLibTemplateMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/SvyLibTemplateMapper.xml
@@ -123,8 +123,8 @@
         LEFT JOIN (select outid,GROUP_CONCAT(icd10code) as icd10code,GROUP_CONCAT(icd10name) as icd10name from
         icd10_association group by outid) b ON a.del_flag = 0
         AND a.svyid = b.outid
-        <where>
-            a.del_flag=0
+        where 1=1
+            and a.del_flag=0
             <if test="categoryid != null ">and a.categoryid = #{categoryid}</if>
             <if test="svyid != null ">and a.svyid = #{svyid}</if>
             <if test="longTemp != null ">and a.long_temp = #{longTemp}</if>
@@ -132,7 +132,6 @@
             <if test="svyname != null  and svyname != ''">and a.svyname like concat('%', #{svyname}, '%')</if>
             <if test="description != null  and description != ''">and b.icd10name like concat('%', #{description}, '%')
             </if>
-        </where>
         order by a.create_time desc
     </select>
 
diff --git a/smartor/src/main/resources/mapper/smartor/SvyLibTemplateScriptMapper.xml b/smartor/src/main/resources/mapper/smartor/SvyLibTemplateScriptMapper.xml
index b928d09..e3931d9 100644
--- a/smartor/src/main/resources/mapper/smartor/SvyLibTemplateScriptMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/SvyLibTemplateScriptMapper.xml
@@ -92,8 +92,8 @@
     <select id="selectSvyLibTemplateScriptList" parameterType="com.smartor.domain.SvyLibTemplateScript"
             resultMap="SvyLibTemplateScriptResult">
         <include refid="selectSvyLibTemplateScriptVo"/>
-        <where>
-            del_flag=0
+        where 1=1
+            and del_flag = 0
             <if test="nextScriptno != null ">and next_scriptno = #{nextScriptno}</if>
             <if test="scriptType != null  and scriptType != ''">and script_type = #{scriptType}</if>
             <if test="scriptno != null  and scriptno != ''">and scriptno = #{scriptno}</if>
@@ -130,7 +130,6 @@
             <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>
-        </where>
     </select>
 
     <select id="selectSvyLibTemplateScriptByTopicid" parameterType="Long" resultMap="SvyLibTemplateScriptResult">
diff --git a/smartor/src/main/resources/mapper/smartor/SvyLibTemplateScriptWjxMapper.xml b/smartor/src/main/resources/mapper/smartor/SvyLibTemplateScriptWjxMapper.xml
index c29d7f2..91462fa 100644
--- a/smartor/src/main/resources/mapper/smartor/SvyLibTemplateScriptWjxMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/SvyLibTemplateScriptWjxMapper.xml
@@ -47,7 +47,7 @@
 
     <select id="selectSvyLibTemplateScriptWjxList" parameterType="com.smartor.domain.SvyLibTemplateScriptWjx" resultMap="SvyLibTemplateScriptWjxResult">
         <include refid="selectSvyLibTemplateScriptWjxVo"/>
-        <where>
+        where 1=1
             <if test="oldid != null "> and oldid = #{oldid}</if>
             <if test="svyid != null "> and svyid = #{svyid}</if>
             <if test="scriptType != null  and scriptType != ''"> and script_type = #{scriptType}</if>
@@ -76,7 +76,6 @@
             <if test="scoretype != null  and scoretype != ''"> and scoretype = #{scoretype}</if>
             <if test="score != null  and score != ''"> and score = #{score}</if>
             <if test="scriptDesc != null  and scriptDesc != ''"> and script_desc = #{scriptDesc}</if>
-        </where>
     </select>
 
     <select id="selectSvyLibTemplateScriptWjxById" parameterType="Long" resultMap="SvyLibTemplateScriptWjxResult">
diff --git a/smartor/src/main/resources/mapper/smartor/SvyLibTemplateTagMapper.xml b/smartor/src/main/resources/mapper/smartor/SvyLibTemplateTagMapper.xml
index 753ca27..f7c962e 100644
--- a/smartor/src/main/resources/mapper/smartor/SvyLibTemplateTagMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/SvyLibTemplateTagMapper.xml
@@ -44,8 +44,8 @@
     <select id="selectSvyLibTemplateTagList" parameterType="com.smartor.domain.SvyLibTemplateTag"
             resultMap="SvyLibTemplateTagResult">
         <include refid="selectSvyLibTemplateTagVo"/>
-        <where>
-            del_flag=0
+        where 1=1
+            and del_flag = 0
             <if test="tagcategoryid != null ">and tagcategoryid = #{tagcategoryid}</if>
             <if test="templateid != null ">and templateid = #{templateid}</if>
             <if test="tagid != null ">and tagid = #{tagid}</if>
@@ -55,7 +55,6 @@
             <if test="uploadTime != null ">and upload_time = #{uploadTime}</if>
             <if test="pid != null ">and pid = #{pid}</if>
             <if test="guid != null  and guid != ''">and guid = #{guid}</if>
-        </where>
     </select>
 
     <select id="selectSvyLibTemplateTagById" parameterType="Long" resultMap="SvyLibTemplateTagResult">
diff --git a/smartor/src/main/resources/mapper/smartor/SvyLibTemplateTargetoptionMapper.xml b/smartor/src/main/resources/mapper/smartor/SvyLibTemplateTargetoptionMapper.xml
index 43e4337..ee9f1d2 100644
--- a/smartor/src/main/resources/mapper/smartor/SvyLibTemplateTargetoptionMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/SvyLibTemplateTargetoptionMapper.xml
@@ -77,8 +77,8 @@
     <select id="selectSvyLibTemplateTargetoptionList" parameterType="com.smartor.domain.SvyLibTemplateTargetoption"
             resultMap="SvyLibTemplateTargetoptionResult">
         <include refid="selectSvyLibTemplateTargetoptionVo"/>
-        <where>
-            del_flag=0
+        where 1=1
+            and del_flag = 0
             <if test="groupid != null  and groupid != ''">and groupid = #{groupid}</if>
             <if test="categoryName != null  and categoryName != ''">and categoryName like concat('%', #{categoryName},
                 '%')
@@ -115,7 +115,6 @@
             <if test="optionNo != null">and option_no = #{optionNo}</if>
             <if test="sendTaskid != null">and send_taskid= #{sendTaskid}</if>
             <if test="sendTaskname != null">and send_taskname = #{sendTaskname}</if>
-        </where>
     </select>
 
     <select id="selectSvyLibTemplateTargetoptionById" parameterType="Long" resultMap="SvyLibTemplateTargetoptionResult">
diff --git a/smartor/src/main/resources/mapper/smartor/SvyLibTemplateTargetoptionWjxMapper.xml b/smartor/src/main/resources/mapper/smartor/SvyLibTemplateTargetoptionWjxMapper.xml
index 718353e..620d242 100644
--- a/smartor/src/main/resources/mapper/smartor/SvyLibTemplateTargetoptionWjxMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/SvyLibTemplateTargetoptionWjxMapper.xml
@@ -69,7 +69,7 @@
             parameterType="com.smartor.domain.SvyLibTemplateTargetoptionWjx"
             resultMap="SvyLibTemplateTargetoptionWjxResult">
         <include refid="selectSvyLibTemplateTargetoptionWjxVo"/>
-        <where>
+        where 1=1
             <if test="groupid != null  and groupid != ''">and groupid = #{groupid}</if>
             <if test="categoryName != null  and categoryName != ''">and categoryName like concat('%', #{categoryName},
                 '%')
@@ -101,7 +101,6 @@
             <if test="appendflag != null  and appendflag != ''">and appendflag = #{appendflag}</if>
             <if test="appenddesc != null  and appenddesc != ''">and appenddesc = #{appenddesc}</if>
             <if test="sort != null">and sort = #{sort}</if>
-        </where>
     </select>
 
     <select id="selectSvyLibTemplateTargetoptionWjxById" parameterType="Long"
diff --git a/smartor/src/main/resources/mapper/smartor/SvyLibTemplateWjxMapper.xml b/smartor/src/main/resources/mapper/smartor/SvyLibTemplateWjxMapper.xml
index d96f6ed..9ab9e05 100644
--- a/smartor/src/main/resources/mapper/smartor/SvyLibTemplateWjxMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/SvyLibTemplateWjxMapper.xml
@@ -82,7 +82,7 @@
     <select id="selectSvyLibTemplateWjxList" parameterType="com.smartor.domain.SvyLibTemplateWjx"
             resultMap="SvyLibTemplateWjxResult">
         <include refid="selectSvyLibTemplateWjxVo"/>
-        <where>
+        where 1=1
             <if test="templateid != null ">and templateid = #{templateid}</if>
             <if test="categoryid != null ">and categoryid = #{categoryid}</if>
             <if test="svycode != null  and svycode != ''">and svycode = #{svycode}</if>
@@ -113,7 +113,6 @@
             <if test="reply != null  and reply != ''">and reply = #{reply}</if>
             <if test="scriptScore != null  and scriptScore != ''">and script_score = #{scriptScore}</if>
             <if test="scoreType != null  and scoreType != ''">and score_type = #{scoreType}</if>
-        </where>
     </select>
 
     <select id="selectSvyLibTemplateWjxBySvyid" parameterType="Long" resultMap="SvyLibTemplateWjxResult">
diff --git a/smartor/src/main/resources/mapper/smartor/SvyLibTopicCategoryMapper.xml b/smartor/src/main/resources/mapper/smartor/SvyLibTopicCategoryMapper.xml
index c14ba52..3c5af8b 100644
--- a/smartor/src/main/resources/mapper/smartor/SvyLibTopicCategoryMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/SvyLibTopicCategoryMapper.xml
@@ -38,15 +38,14 @@
     <select id="selectSvyLibScriptCategoryList" parameterType="com.smartor.domain.SvyLibScriptCategory"
             resultMap="SvyLibScriptCategoryResult">
         <include refid="selectSvyLibScriptCategoryVo"/>
-        <where>
-            del_flag=0
+        where 1=1
+            and del_flag = 0
             <if test="name != null  and name != ''">and name like concat('%', #{name}, '%')</if>
             <if test="topicid != null ">and topicid = #{topicid}</if>
             <if test="pid != null ">and pid = #{pid}</if>
             <if test="guid != null  and guid != ''">and guid = #{guid}</if>
             <if test="orgid != null ">and orgid = #{orgid}</if>
             <if test="seqno != null ">and seqno = #{seqno}</if>
-        </where>
         order by seqno asc
     </select>
 
diff --git a/smartor/src/main/resources/mapper/smartor/SvyLibTopicdirectionMapper.xml b/smartor/src/main/resources/mapper/smartor/SvyLibTopicdirectionMapper.xml
index c3aa74b..96f5bad 100644
--- a/smartor/src/main/resources/mapper/smartor/SvyLibTopicdirectionMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/SvyLibTopicdirectionMapper.xml
@@ -19,11 +19,11 @@
 
     <select id="selectSvyLibTopicdirectionList" parameterType="com.smartor.domain.SvyLibTopicdirection" resultMap="SvyLibTopicdirectionResult">
         <include refid="selectSvyLibTopicdirectionVo"/>
-        <where>
+        where 1=1
+            <if test="orgid != null  and orgid != ''">and orgid = #{orgid}</if>
             <if test="topicid != null "> and topicid = #{topicid}</if>
             <if test="transverse != null  and transverse != ''"> and transverse = #{transverse}</if>
             <if test="direction != null  and direction != ''"> and direction = #{direction}</if>
-        </where>
     </select>
 
     <select id="selectSvyLibTopicdirectionById" parameterType="Long" resultMap="SvyLibTopicdirectionResult">
diff --git a/smartor/src/main/resources/mapper/smartor/SvyTaskAnswerMapper.xml b/smartor/src/main/resources/mapper/smartor/SvyTaskAnswerMapper.xml
index 90b61a4..15a5e0a 100644
--- a/smartor/src/main/resources/mapper/smartor/SvyTaskAnswerMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/SvyTaskAnswerMapper.xml
@@ -54,7 +54,7 @@
     <select id="selectSvyTaskAnswerList" parameterType="com.smartor.domain.SvyTaskAnswer"
             resultMap="SvyTaskAnswerResult">
         <include refid="selectSvyTaskAnswerVo"/>
-        <where>
+        where 1=1
             <if test="taskid != null ">and taskid = #{taskid}</if>
             <if test="singleid != null ">and singleid = #{singleid}</if>
             <if test="scriptid != null ">and scriptid = #{scriptid}</if>
@@ -69,7 +69,6 @@
             <if test="pid != null  and pid != ''">and pid = #{pid}</if>
             <if test="guid != null  and guid != ''">and guid = #{guid}</if>
             <if test="orgid != null  and orgid != ''">and orgid = #{orgid}</if>
-        </where>
     </select>
 
     <select id="selectSvyTaskAnswerById" parameterType="Long" resultMap="SvyTaskAnswerResult">
diff --git a/smartor/src/main/resources/mapper/smartor/SvyTaskMapper.xml b/smartor/src/main/resources/mapper/smartor/SvyTaskMapper.xml
index 6d2da2b..b0c1bdf 100644
--- a/smartor/src/main/resources/mapper/smartor/SvyTaskMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/SvyTaskMapper.xml
@@ -107,7 +107,7 @@
 
     <select id="selectSvyTaskList" parameterType="com.smartor.domain.SvyTask" resultMap="SvyTaskResult">
         <include refid="selectSvyTaskVo"/>
-        <where>
+        where 1=1
             <if test="svrtaskid != null ">and svrtaskid = #{svrtaskid}</if>
             <if test="taskName != null  and taskName != ''">and task_name like concat('%', #{taskName}, '%')</if>
             <if test="templateid != null  and templateid != ''">and templateid = #{templateid}</if>
@@ -150,7 +150,6 @@
             </if>
             <if test="libtemplateid != null ">and libtemplateid = #{libtemplateid}</if>
             <if test="libtemplatename != null  and libtemplatename != ''">and libtemplatename = #{libtemplatename}</if>
-        </where>
     </select>
 
     <select id="selectSvyTaskByTaskid" parameterType="Long" resultMap="SvyTaskResult">
diff --git a/smartor/src/main/resources/mapper/smartor/SvyTaskScriptMapper.xml b/smartor/src/main/resources/mapper/smartor/SvyTaskScriptMapper.xml
index 40ac9bd..1631749 100644
--- a/smartor/src/main/resources/mapper/smartor/SvyTaskScriptMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/SvyTaskScriptMapper.xml
@@ -40,7 +40,7 @@
 
     <select id="selectSvyTaskScriptList" parameterType="com.smartor.domain.SvyTaskScript" resultMap="SvyTaskScriptResult">
         <include refid="selectSvyTaskScriptVo"/>
-        <where>
+        where 1=1
             <if test="scriptType != null "> and script_type = #{scriptType}</if>
             <if test="scriptCode != null  and scriptCode != ''"> and script_code = #{scriptCode}</if>
             <if test="script != null  and script != ''"> and script = #{script}</if>
@@ -62,7 +62,6 @@
             <if test="score != null  and score != ''"> and score = #{score}</if>
             <if test="showtype != null  and showtype != ''"> and showtype = #{showtype}</if>
             <if test="picturePath != null  and picturePath != ''"> and picture_path = #{picturePath}</if>
-        </where>
     </select>
 
     <select id="selectSvyTaskScriptById" parameterType="Long" resultMap="SvyTaskScriptResult">
diff --git a/smartor/src/main/resources/mapper/smartor/SvyTaskScriptoptionMapper.xml b/smartor/src/main/resources/mapper/smartor/SvyTaskScriptoptionMapper.xml
index 712201f..dd63a05 100644
--- a/smartor/src/main/resources/mapper/smartor/SvyTaskScriptoptionMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/SvyTaskScriptoptionMapper.xml
@@ -54,7 +54,7 @@
 
     <select id="selectSvyTaskScriptoptionList" parameterType="com.smartor.domain.SvyTaskScriptoption" resultMap="SvyTaskScriptoptionResult">
         <include refid="selectSvyTaskScriptoptionVo"/>
-        <where>
+        where 1=1
             <if test="taskScriptId != null "> and task_script_id = #{taskScriptId}</if>
             <if test="svyid != null "> and svyid = #{svyid}</if>
             <if test="scriptType != null "> and script_type = #{scriptType}</if>
@@ -90,7 +90,6 @@
             <if test="scoretype != null  and scoretype != ''"> and scoretype = #{scoretype}</if>
             <if test="showtype != null  and showtype != ''"> and showtype = #{showtype}</if>
             <if test="picturePath != null  and picturePath != ''"> and picture_path = #{picturePath}</if>
-        </where>
     </select>
 
     <select id="selectSvyTaskScriptoptionById" parameterType="Long" resultMap="SvyTaskScriptoptionResult">
diff --git a/smartor/src/main/resources/mapper/smartor/SvyTaskSingleMapper.xml b/smartor/src/main/resources/mapper/smartor/SvyTaskSingleMapper.xml
index dd787d7..5e5873c 100644
--- a/smartor/src/main/resources/mapper/smartor/SvyTaskSingleMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/SvyTaskSingleMapper.xml
@@ -144,7 +144,7 @@
     <select id="selectSvyTaskSingleList" parameterType="com.smartor.domain.SvyTaskSingle"
             resultMap="SvyTaskSingleResult">
         <include refid="selectSvyTaskSingleVo"/>
-        <where>
+        where 1=1
             <if test="sendname != null  and sendname != ''">and sendname like concat('%', #{sendname}, '%')</if>
             <if test="phone != null  and phone != ''">and phone = #{phone}</if>
             <if test="sex != null  and sex != ''">and sex = #{sex}</if>
@@ -207,7 +207,6 @@
             <if test="roomno != null  and roomno != ''">and roomno = #{roomno}</if>
             <if test="bedno != null  and bedno != ''">and bedno = #{bedno}</if>
             <if test="patid != null ">and patid = #{patid}</if>
-        </where>
     </select>
 
     <select id="selectSvyTaskSingleById" parameterType="Long" resultMap="SvyTaskSingleResult">
diff --git a/smartor/src/main/resources/mapper/smartor/SvyTaskTemplateMapper.xml b/smartor/src/main/resources/mapper/smartor/SvyTaskTemplateMapper.xml
index 4091b73..31eb308 100644
--- a/smartor/src/main/resources/mapper/smartor/SvyTaskTemplateMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/SvyTaskTemplateMapper.xml
@@ -92,8 +92,8 @@
     <select id="selectSvyTaskTemplateList" parameterType="com.smartor.domain.SvyTaskTemplate"
             resultMap="SvyTaskTemplateResult">
         <include refid="selectSvyTaskTemplateVo"/>
-        <where>
-            del_flag=0
+        where 1=1
+            and del_flag = 0
             <if test="templateid != null ">and templateid = #{templateid}</if>
             <if test="id != null ">and id = #{id}</if>
             <if test="categoryid != null ">and categoryid = #{categoryid}</if>
@@ -127,7 +127,6 @@
             <if test="deptCode != null ">and dept_code = #{deptCode}</if>
             <if test="longTemp != null ">and long_temp = #{longTemp}</if>
             <if test="sendDay != null ">and send_day = #{sendDay}</if>
-        </where>
     </select>
 
     <select id="selectSvyTaskTemplateBySvyid" parameterType="Long" resultMap="SvyTaskTemplateResult">
diff --git a/smartor/src/main/resources/mapper/smartor/SvyTaskTemplateScriptMapper.xml b/smartor/src/main/resources/mapper/smartor/SvyTaskTemplateScriptMapper.xml
index f0737c4..57dba35 100644
--- a/smartor/src/main/resources/mapper/smartor/SvyTaskTemplateScriptMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/SvyTaskTemplateScriptMapper.xml
@@ -72,7 +72,7 @@
     <select id="selectSvyTaskTemplateScriptList" parameterType="com.smartor.domain.SvyTaskTemplateScript"
             resultMap="SvyTaskTemplateScriptResult">
         <include refid="selectSvyTaskTemplateScriptVo"/>
-        <where>
+        where 1=1
             <if test="taskid != null ">and taskid = #{taskid}</if>
             <if test="categoryid != null ">and categoryid = #{categoryid}</if>
             <if test="ishide != null ">and ishide = #{ishide}</if>
@@ -110,7 +110,6 @@
             <if test="branchNextscriptno != null  and branchNextscriptno != ''">and branch_nextscriptno =
                 #{branchNextscriptno}
             </if>
-        </where>
     </select>
 
     <select id="selectSvyTaskTemplateScriptByID" parameterType="Long" resultMap="SvyTaskTemplateScriptResult">
diff --git a/smartor/src/main/resources/mapper/smartor/SvyTaskTemplateTargetoptionMapper.xml b/smartor/src/main/resources/mapper/smartor/SvyTaskTemplateTargetoptionMapper.xml
index 46702b3..695fdcc 100644
--- a/smartor/src/main/resources/mapper/smartor/SvyTaskTemplateTargetoptionMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/SvyTaskTemplateTargetoptionMapper.xml
@@ -72,8 +72,8 @@
     <select id="selectSvyTaskTemplateTargetoptionList" parameterType="com.smartor.domain.SvyTaskTemplateTargetoption"
             resultMap="SvyTaskTemplateTargetoptionResult">
         <include refid="selectSvyTaskTemplateTargetoptionVo"/>
-        <where>
-            del_flag=0
+        where 1=1
+            and del_flag = 0
             <if test="taskid != null ">and taskid = #{taskid}</if>
             <if test="score != null ">and score = #{score}</if>
             <if test="prompt != null ">and prompt = #{prompt}</if>
@@ -109,7 +109,6 @@
             <if test="appenddesc != null">and appenddesc = #{appenddesc}</if>
             <if test="sendTaskid != null">and send_taskid= #{sendTaskid}</if>
             <if test="sendTaskname != null">and send_taskname = #{sendTaskname}</if>
-        </where>
     </select>
 
     <select id="selectSvyTaskTemplateTargetoptionById" parameterType="Long"
diff --git a/smartor/src/main/resources/mapper/smartor/SvyTopicMapper.xml b/smartor/src/main/resources/mapper/smartor/SvyTopicMapper.xml
index b71d149..f2cb92a 100644
--- a/smartor/src/main/resources/mapper/smartor/SvyTopicMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/SvyTopicMapper.xml
@@ -47,7 +47,7 @@
 
     <select id="selectSvyTopicList" parameterType="com.smartor.domain.SvyTopic" resultMap="SvyTopicResult">
         <include refid="selectSvyTopicVo"/>
-        <where>
+        where 1=1
             <if test="topictype != null ">and topictype = #{topictype}</if>
             <if test="topiccode != null  and topiccode != ''">and topiccode = #{topiccode}</if>
             <if test="topic != null  and topic != ''">and topic = #{topic}</if>
@@ -58,7 +58,6 @@
             <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>
-        </where>
     </select>
 
     <select id="selectSvyTopicByTopicid" parameterType="Long" resultMap="SvyTopicResult">
diff --git a/smartor/src/main/resources/mapper/smartor/SvyTopicoptionMapper.xml b/smartor/src/main/resources/mapper/smartor/SvyTopicoptionMapper.xml
index 3f492aa..b95d882 100644
--- a/smartor/src/main/resources/mapper/smartor/SvyTopicoptionMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/SvyTopicoptionMapper.xml
@@ -78,7 +78,7 @@
     <select id="selectSvyTopicoptionList" parameterType="com.smartor.domain.SvyTopicoption"
             resultMap="SvyTopicoptionResult">
         <include refid="selectSvyTopicoptionVo"/>
-        <where>
+        where 1=1
             <if test="topicid != null ">and topicid = #{topicid}</if>
             <if test="svyid != null ">and svyid = #{svyid}</if>
             <if test="topictype != null ">and topictype = #{topictype}</if>
@@ -104,7 +104,6 @@
             <if test="oldid != null ">and oldid = #{oldid}</if>
             <if test="isupload != null ">and isupload = #{isupload}</if>
             <if test="uploadTime != null ">and upload_time = #{uploadTime}</if>
-        </where>
     </select>
 
     <select id="selectSvyTopicoptionByOptionid" parameterType="Long" resultMap="SvyTopicoptionResult">
diff --git a/smartor/src/main/resources/mapper/smartor/SysUserDeptMapper.xml b/smartor/src/main/resources/mapper/smartor/SysUserDeptMapper.xml
index 0c57056..ca6fd04 100644
--- a/smartor/src/main/resources/mapper/smartor/SysUserDeptMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/SysUserDeptMapper.xml
@@ -47,8 +47,8 @@
     <select id="selectSysUserDeptList" parameterType="com.ruoyi.common.core.domain.entity.SysUserDept"
             resultMap="SysUserDeptResult">
         <include refid="selectSysUserDeptVo"/>
-        <where>
-            del_flag=0
+        where 1=1
+            and del_flag = 0
             and orgid=#{orgid}
             <if test="userId != null ">
                 and user_id = #{userId}
@@ -74,7 +74,6 @@
             <if test="campusid != null ">
                 and campusid = #{campusid}
             </if>
-        </where>
     </select>
 
     <select id="selectSysUserDeptById" parameterType="Long"
diff --git a/smartor/src/main/resources/mapper/smartor/SysUserImportMapper.xml b/smartor/src/main/resources/mapper/smartor/SysUserImportMapper.xml
index d0cd5b7..c248c2a 100644
--- a/smartor/src/main/resources/mapper/smartor/SysUserImportMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/SysUserImportMapper.xml
@@ -116,7 +116,7 @@
     <select id="selectSysUserImportList" parameterType="com.smartor.domain.SysUserImport"
             resultMap="SysUserImportResult">
         <include refid="selectSysUserImportVo"/>
-        <where>
+        where 1=1
             <if test="subId != null ">
                 and sub_id = #{subId}
             </if>
@@ -249,7 +249,6 @@
             <if test="defaultWardName != null  and defaultWardName != ''">
                 and default_ward_name = #{defaultWardName}
             </if>
-        </where>
     </select>
 
     <select id="selectSysUserImportById" parameterType="Long"
diff --git a/smartor/src/main/resources/mapper/smartor/SysUserRole2Mapper.xml b/smartor/src/main/resources/mapper/smartor/SysUserRole2Mapper.xml
index 8f4154a..6e21fb5 100644
--- a/smartor/src/main/resources/mapper/smartor/SysUserRole2Mapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/SysUserRole2Mapper.xml
@@ -26,11 +26,10 @@
     <select id="selectUserRoleByRoleIdAndUserId" resultMap="SysUserRoleResult">
         select user_id,role_id,guid,orgid
         from sys_user_role
-        <where>
+        where 1=1
             <if test="roleId != null ">and role_id = #{roleId}</if>
             <if test="userId != null ">and user_id = #{userId}</if>
 
-        </where>
     </select>
 
     <delete id="deleteUserRole" parameterType="Long">
diff --git a/smartor/src/main/resources/mapper/smartor/TemplateDeptMapper.xml b/smartor/src/main/resources/mapper/smartor/TemplateDeptMapper.xml
index 8c84d8f..694d13d 100644
--- a/smartor/src/main/resources/mapper/smartor/TemplateDeptMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/TemplateDeptMapper.xml
@@ -38,8 +38,8 @@
     <select id="selectTemplateDeptList" parameterType="com.smartor.domain.TemplateDept"
             resultMap="TemplateDeptResult">
         <include refid="selectTemplateDeptVo"/>
-        <where>
-            del_flag=0
+        where 1=1
+            and del_flag = 0
             <if test="type != null ">
                 and type = #{type}
             </if>
@@ -61,7 +61,6 @@
             <if test="longTemp != null  and longTemp != ''">
                 and long_temp = #{longTemp}
             </if>
-        </where>
     </select>
 
     <select id="selectTemplateDeptById" parameterType="Long"

--
Gitblit v1.9.3