Quellcode durchsuchen

1.增加用户工号2.完成his映射。3.修改知识库和标准映射

zjh vor 2 Jahren
Ursprung
Commit
8cbed5fc8a
17 geänderte Dateien mit 144 neuen und 55 gelöschten Zeilen
  1. BIN
      cbkj_web_parameter/src/main/java/com/jiuzhekan/cbkj/beans/sysBeans/AdminInfo.java
  2. BIN
      cbkj_web_parameter/src/main/java/com/jiuzhekan/cbkj/beans/sysBeans/SysDoctorMultipoint.java
  3. BIN
      cbkj_web_parameter/src/main/java/com/jiuzhekan/cbkj/controller/drug/TCenterHisMappingController.java
  4. BIN
      cbkj_web_parameter/src/main/java/com/jiuzhekan/cbkj/mapper/drug/TCenterHisMappingMapper.java
  5. BIN
      cbkj_web_parameter/src/main/java/com/jiuzhekan/cbkj/service/drug/BStandardMatService.java
  6. BIN
      cbkj_web_parameter/src/main/java/com/jiuzhekan/cbkj/service/drug/TAppMaterialMappingService.java
  7. BIN
      cbkj_web_parameter/src/main/java/com/jiuzhekan/cbkj/service/drug/TCenterHisMappingService.java
  8. BIN
      cbkj_web_parameter/src/main/java/com/jiuzhekan/cbkj/service/drug/TStandardMaterialMappingService.java
  9. BIN
      cbkj_web_parameter/src/main/java/com/jiuzhekan/cbkj/service/sysService/AdminService.java
  10. 11 11
      cbkj_web_parameter/src/main/resources/mappers/bs/BsAreaMapper.xml
  11. 11 11
      cbkj_web_parameter/src/main/resources/mappers/bs/BsCityMapper.xml
  12. 11 11
      cbkj_web_parameter/src/main/resources/mappers/bs/BsProvinceMapper.xml
  13. 11 11
      cbkj_web_parameter/src/main/resources/mappers/bs/BsStreetMapper.xml
  14. 5 1
      cbkj_web_parameter/src/main/resources/mappers/drug/BStandardMatMapper.xml
  15. 13 4
      cbkj_web_parameter/src/main/resources/mappers/drug/TAppMaterialMappingMapper.xml
  16. 78 2
      cbkj_web_parameter/src/main/resources/mappers/drug/TCenterHisMappingMapper.xml
  17. 4 4
      cbkj_web_parameter/src/main/resources/mappers/drug/TStandardMaterialMappingMapper.xml

BIN
cbkj_web_parameter/src/main/java/com/jiuzhekan/cbkj/beans/sysBeans/AdminInfo.java


BIN
cbkj_web_parameter/src/main/java/com/jiuzhekan/cbkj/beans/sysBeans/SysDoctorMultipoint.java


BIN
cbkj_web_parameter/src/main/java/com/jiuzhekan/cbkj/controller/drug/TCenterHisMappingController.java


BIN
cbkj_web_parameter/src/main/java/com/jiuzhekan/cbkj/mapper/drug/TCenterHisMappingMapper.java


BIN
cbkj_web_parameter/src/main/java/com/jiuzhekan/cbkj/service/drug/BStandardMatService.java


BIN
cbkj_web_parameter/src/main/java/com/jiuzhekan/cbkj/service/drug/TAppMaterialMappingService.java


BIN
cbkj_web_parameter/src/main/java/com/jiuzhekan/cbkj/service/drug/TCenterHisMappingService.java


BIN
cbkj_web_parameter/src/main/java/com/jiuzhekan/cbkj/service/drug/TStandardMaterialMappingService.java


BIN
cbkj_web_parameter/src/main/java/com/jiuzhekan/cbkj/service/sysService/AdminService.java


+ 11 - 11
cbkj_web_parameter/src/main/resources/mappers/bs/BsAreaMapper.xml

@@ -23,12 +23,12 @@
     </sql>
 
     <delete id="deleteByPrimaryKey" parameterType="BsArea">
-        delete from bs_area where AREA_ID = #{ areaId }
+        delete from sys_area where AREA_ID = #{ areaId }
     </delete>
 
     <!--根据主键批量删除-->
     <delete id="deleteBylist" parameterType="ArrayList">
-        delete from bs_area where AREA_ID in
+        delete from sys_area where AREA_ID in
         <foreach collection="array" item="item" open="(" separator="," close=")">
         #{item}
         </foreach>
@@ -36,20 +36,20 @@
 
     <!--单个插入-->
     <insert id="insert"  parameterType="BsArea">
-        insert into bs_area (AREA_ID,AREA_CODE,CITY_CODE,AREA_NAME,AREA_SHORT_NAME,AREA_LNG,AREA_LAT,SORT,CREATE_DATE,MODIFY_DATE,`DESC`,status) values
+        insert into sys_area (AREA_ID,AREA_CODE,CITY_CODE,AREA_NAME,AREA_SHORT_NAME,AREA_LNG,AREA_LAT,SORT,CREATE_DATE,MODIFY_DATE,`DESC`,status) values
         (#{areaId},#{areaCode},#{cityCode},#{areaName},#{areaShortName},#{areaLng},#{areaLat},#{sort},#{createDate},#{modifyDate},#{desc},#{status})
     </insert>
 
     <!--批量插入-->
     <insert id="insertList" parameterType="List">
-        insert into bs_area (AREA_ID,AREA_CODE,CITY_CODE,AREA_NAME,AREA_SHORT_NAME,AREA_LNG,AREA_LAT,SORT,CREATE_DATE,MODIFY_DATE,`DESC`,status) values
+        insert into sys_area (AREA_ID,AREA_CODE,CITY_CODE,AREA_NAME,AREA_SHORT_NAME,AREA_LNG,AREA_LAT,SORT,CREATE_DATE,MODIFY_DATE,`DESC`,status) values
         <foreach collection="list" item="item" index="index" separator="," >
             (#{item.areaId},#{item.areaCode},#{item.cityCode},#{item.areaName},#{item.areaShortName},#{item.areaLng},#{item.areaLat},#{item.sort},#{item.createDate},#{item.modifyDate},#{item.desc},#{item.status})
         </foreach>
     </insert>
 
     <update id="updateByPrimaryKey" parameterType="BsArea">
-        update bs_area
+        update sys_area
         <set>
              <if test="areaCode != null">
                 AREA_CODE = #{ areaCode },
@@ -90,7 +90,7 @@
 
     <!-- 更新多个或者单个字段 -->
     <update id="updateM" parameterType="Map">
-        update bs_area set ${filed}=#{filedValue}
+        update sys_area set ${filed}=#{filedValue}
         <if test="filed2!=null and filed2!=''">,${filed2}=#{filedValue2}</if>
         <if test="filed3!=null and filed3!=''">,${filed3}=#{filedValue3}</if>
         <if test="filed4!=null and filed4!=''">,${filed4}=#{filedValue4}</if>
@@ -103,7 +103,7 @@
 
     <!--查询某个字段的某条数据数量-->
     <select id="getObjExists" parameterType="Map" resultType="int">
-        select count(1) cun from bs_area where 1=1
+        select count(1) cun from sys_area where 1=1
         <if test="key!=null and key!=''">
             and ${key} = #{value}
         </if>
@@ -119,17 +119,17 @@
 
     <select id="getMapById" resultType="Map" parameterType="String">
         select <include refid="Base_Column_List" />
-        from bs_area where AREA_ID = #{id}
+        from sys_area where AREA_ID = #{id}
     </select>
 
     <select id="getObjectById" resultMap="BaseResultMap" parameterType="String">
         select <include refid="Base_Column_List" />
-        from bs_area where AREA_ID = #{id}
+        from sys_area where AREA_ID = #{id}
     </select>
 
     <!--分页查询基础语句返回Map-->
     <select id="getPageDatas" parameterType="BsArea" resultType="Map">
-        SELECT AREA_ID,AREA_CODE,CITY_CODE,AREA_NAME,AREA_SHORT_NAME,AREA_LNG,AREA_LAT,SORT,CREATE_DATE,MODIFY_DATE,`DESC`,status  from bs_area
+        SELECT AREA_ID,AREA_CODE,CITY_CODE,AREA_NAME,AREA_SHORT_NAME,AREA_LNG,AREA_LAT,SORT,CREATE_DATE,MODIFY_DATE,`DESC`,status  from sys_area
         where 1=1
     </select>
 
@@ -137,7 +137,7 @@
     <!--分页查询基础语句返回对象-->
     <select id="getPageListByObj" parameterType="BsArea" resultMap="BaseResultMap">
         SELECT AREA_ID,AREA_CODE,CITY_CODE,AREA_NAME,AREA_SHORT_NAME,AREA_LNG,AREA_LAT,status
-        from bs_area
+        from sys_area
         where 1=1
         <if test="cityCode != null and cityCode!='' ">
             and CITY_CODE  = #{cityCode}

+ 11 - 11
cbkj_web_parameter/src/main/resources/mappers/bs/BsCityMapper.xml

@@ -23,12 +23,12 @@
     </sql>
 
     <delete id="deleteByPrimaryKey" parameterType="BsCity">
-        delete from bs_city where CITY_ID = #{ cityId }
+        delete from sys_city where CITY_ID = #{ cityId }
     </delete>
 
     <!--根据主键批量删除-->
     <delete id="deleteBylist" parameterType="ArrayList">
-        delete from bs_city where CITY_ID in
+        delete from sys_city where CITY_ID in
         <foreach collection="array" item="item" open="(" separator="," close=")">
         #{item}
         </foreach>
@@ -36,20 +36,20 @@
 
     <!--单个插入-->
     <insert id="insert"  parameterType="BsCity">
-        insert into bs_city (CITY_ID,CITY_CODE,CITY_NAME,CITY_SHORT_NAME,PROVINCE_CODE,CITY_LNG,CITY_LAT,SORT,CREATE_DATE,MODIFY_DATE,`DESC`,status) values
+        insert into sys_city (CITY_ID,CITY_CODE,CITY_NAME,CITY_SHORT_NAME,PROVINCE_CODE,CITY_LNG,CITY_LAT,SORT,CREATE_DATE,MODIFY_DATE,`DESC`,status) values
         (#{cityId},#{cityCode},#{cityName},#{cityShortName},#{provinceCode},#{cityLng},#{cityLat},#{sort},#{createDate},#{modifiedDate},#{desc},#{status})
     </insert>
 
     <!--批量插入-->
     <insert id="insertList" parameterType="List">
-        insert into bs_city (CITY_ID,CITY_CODE,CITY_NAME,CITY_SHORT_NAME,PROVINCE_CODE,CITY_LNG,CITY_LAT,SORT,CREATE_DATE,MODIFY_DATE,`DESC`,status) values
+        insert into sys_city (CITY_ID,CITY_CODE,CITY_NAME,CITY_SHORT_NAME,PROVINCE_CODE,CITY_LNG,CITY_LAT,SORT,CREATE_DATE,MODIFY_DATE,`DESC`,status) values
         <foreach collection="list" item="item" index="index" separator="," >
             (#{item.cityId},#{item.cityCode},#{item.cityName},#{item.cityShortName},#{item.provinceCode},#{item.cityLng},#{item.cityLat},#{item.sort},#{item.createDate},#{item.modifiedDate},#{item.desc},#{item.status})
         </foreach>
     </insert>
 
     <update id="updateByPrimaryKey" parameterType="BsCity">
-        update bs_city
+        update sys_city
         <set>
              <if test="cityCode != null">
                 CITY_CODE = #{ cityCode },
@@ -90,7 +90,7 @@
 
     <!-- 更新多个或者单个字段 -->
     <update id="updateM" parameterType="Map">
-        update bs_city set ${filed}=#{filedValue}
+        update sys_city set ${filed}=#{filedValue}
         <if test="filed2!=null and filed2!=''">,${filed2}=#{filedValue2}</if>
         <if test="filed3!=null and filed3!=''">,${filed3}=#{filedValue3}</if>
         <if test="filed4!=null and filed4!=''">,${filed4}=#{filedValue4}</if>
@@ -103,7 +103,7 @@
 
     <!--查询某个字段的某条数据数量-->
     <select id="getObjExists" parameterType="Map" resultType="int">
-        select count(1) cun from bs_city where 1=1
+        select count(1) cun from sys_city where 1=1
         <if test="key!=null and key!=''">
             and ${key} = #{value}
         </if>
@@ -119,17 +119,17 @@
 
     <select id="getMapById" resultType="Map" parameterType="String">
         select <include refid="Base_Column_List" />
-        from bs_city where CITY_ID = #{id}
+        from sys_city where CITY_ID = #{id}
     </select>
 
     <select id="getObjectById" resultMap="BaseResultMap" parameterType="String">
         select <include refid="Base_Column_List" />
-        from bs_city where CITY_ID = #{id}
+        from sys_city where CITY_ID = #{id}
     </select>
 
     <!--分页查询基础语句返回Map-->
     <select id="getPageDatas" parameterType="BsCity" resultType="Map">
-        SELECT CITY_ID,CITY_CODE,CITY_NAME,CITY_SHORT_NAME,PROVINCE_CODE,CITY_LNG,CITY_LAT,SORT,CREATE_DATE,MODIFY_DATE,`DESC`,status  from bs_city
+        SELECT CITY_ID,CITY_CODE,CITY_NAME,CITY_SHORT_NAME,PROVINCE_CODE,CITY_LNG,CITY_LAT,SORT,CREATE_DATE,MODIFY_DATE,`DESC`,status  from sys_city
         where 1=1
     </select>
 
@@ -137,7 +137,7 @@
     <!--分页查询基础语句返回对象-->
     <select id="getPageListByObj" parameterType="BsCity" resultMap="BaseResultMap">
         SELECT CITY_ID,CITY_CODE,CITY_NAME,CITY_SHORT_NAME,PROVINCE_CODE,CITY_LNG,CITY_LAT,status
-        from bs_city
+        from sys_city
         where 1=1
         <if test="provinceCode != null and provinceCode!='' ">
         and PROVINCE_CODE  = #{provinceCode}

+ 11 - 11
cbkj_web_parameter/src/main/resources/mappers/bs/BsProvinceMapper.xml

@@ -22,12 +22,12 @@
     </sql>
 
     <delete id="deleteByPrimaryKey" parameterType="BsProvince">
-        delete from bs_province where PROVINCE_ID = #{ provinceId }
+        delete from sys_province where PROVINCE_ID = #{ provinceId }
     </delete>
 
     <!--根据主键批量删除-->
     <delete id="deleteBylist" parameterType="ArrayList">
-        delete from bs_province where PROVINCE_ID in
+        delete from sys_province where PROVINCE_ID in
         <foreach collection="array" item="item" open="(" separator="," close=")">
         #{item}
         </foreach>
@@ -35,20 +35,20 @@
 
     <!--单个插入-->
     <insert id="insert"  parameterType="BsProvince">
-        insert into bs_province (PROVINCE_ID,PROVINCE_CODE,PROVINCE_NAME,PROVINCE_SHORT_NAME,PROVINCE_LNG,PROVINCE_LAT,SORT,CREATE_DATE,MODIFY_DATE,`DESC`,status) values
+        insert into sys_province (PROVINCE_ID,PROVINCE_CODE,PROVINCE_NAME,PROVINCE_SHORT_NAME,PROVINCE_LNG,PROVINCE_LAT,SORT,CREATE_DATE,MODIFY_DATE,`DESC`,status) values
         (#{provinceId},#{provinceCode},#{provinceName},#{provinceShortName},#{provinceLng},#{provinceLat},#{sort},#{createDate},#{modifyDate},#{desc},#{status})
     </insert>
 
     <!--批量插入-->
     <insert id="insertList" parameterType="List">
-        insert into bs_province (PROVINCE_ID,PROVINCE_CODE,PROVINCE_NAME,PROVINCE_SHORT_NAME,PROVINCE_LNG,PROVINCE_LAT,SORT,CREATE_DATE,MODIFY_DATE,`DESC`,status) values
+        insert into sys_province (PROVINCE_ID,PROVINCE_CODE,PROVINCE_NAME,PROVINCE_SHORT_NAME,PROVINCE_LNG,PROVINCE_LAT,SORT,CREATE_DATE,MODIFY_DATE,`DESC`,status) values
         <foreach collection="list" item="item" index="index" separator="," >
             (#{item.provinceId},#{item.provinceCode},#{item.provinceName},#{item.provinceShortName},#{item.provinceLng},#{item.provinceLat},#{item.sort},#{item.createDate},#{item.modifyDate},#{item.desc},#{item.status})
         </foreach>
     </insert>
 
     <update id="updateByPrimaryKey" parameterType="BsProvince">
-        update bs_province
+        update sys_province
         <set>
              <if test="provinceCode != null">
                 PROVINCE_CODE = #{ provinceCode },
@@ -86,7 +86,7 @@
 
     <!-- 更新多个或者单个字段 -->
     <update id="updateM" parameterType="Map">
-        update bs_province set ${filed}=#{filedValue}
+        update sys_province set ${filed}=#{filedValue}
         <if test="filed2!=null and filed2!=''">,${filed2}=#{filedValue2}</if>
         <if test="filed3!=null and filed3!=''">,${filed3}=#{filedValue3}</if>
         <if test="filed4!=null and filed4!=''">,${filed4}=#{filedValue4}</if>
@@ -99,7 +99,7 @@
 
     <!--查询某个字段的某条数据数量-->
     <select id="getObjExists" parameterType="Map" resultType="int">
-        select count(1) cun from bs_province where 1=1
+        select count(1) cun from sys_province where 1=1
         <if test="key!=null and key!=''">
             and ${key} = #{value}
         </if>
@@ -115,17 +115,17 @@
 
     <select id="getMapById" resultType="Map" parameterType="String">
         select <include refid="Base_Column_List" />
-        from bs_province where PROVINCE_ID = #{id}
+        from sys_province where PROVINCE_ID = #{id}
     </select>
 
     <select id="getObjectById" resultMap="BaseResultMap" parameterType="String">
         select <include refid="Base_Column_List" />
-        from bs_province where PROVINCE_ID = #{id}
+        from sys_province where PROVINCE_ID = #{id}
     </select>
 
     <!--分页查询基础语句返回Map-->
     <select id="getPageDatas" parameterType="BsProvince" resultType="Map">
-        SELECT PROVINCE_ID,PROVINCE_CODE,PROVINCE_NAME,PROVINCE_SHORT_NAME,PROVINCE_LNG,PROVINCE_LAT,SORT,CREATE_DATE,MODIFY_DATE,`DESC`,status  from bs_province
+        SELECT PROVINCE_ID,PROVINCE_CODE,PROVINCE_NAME,PROVINCE_SHORT_NAME,PROVINCE_LNG,PROVINCE_LAT,SORT,CREATE_DATE,MODIFY_DATE,`DESC`,status  from sys_province
         where 1=1
     </select>
 
@@ -133,7 +133,7 @@
     <!--分页查询基础语句返回对象-->
     <select id="getPageListByObj" parameterType="BsProvince" resultMap="BaseResultMap">
         SELECT PROVINCE_ID,PROVINCE_CODE,PROVINCE_NAME,PROVINCE_SHORT_NAME,PROVINCE_LNG,PROVINCE_LAT,status
-        from bs_province
+        from sys_province
         order by SORT
     </select>
 

+ 11 - 11
cbkj_web_parameter/src/main/resources/mappers/bs/BsStreetMapper.xml

@@ -23,12 +23,12 @@
     </sql>
 
     <delete id="deleteByPrimaryKey" parameterType="BsStreet">
-        delete from bs_street where STREET_ID = #{ streetId }
+        delete from sys_street where STREET_ID = #{ streetId }
     </delete>
 
     <!--根据主键批量删除-->
     <delete id="deleteBylist" parameterType="ArrayList">
-        delete from bs_street where STREET_ID in
+        delete from sys_street where STREET_ID in
         <foreach collection="array" item="item" open="(" separator="," close=")">
         #{item}
         </foreach>
@@ -36,20 +36,20 @@
 
     <!--单个插入-->
     <insert id="insert"  parameterType="BsStreet">
-        insert into bs_street (STREET_ID,STREET_CODE,AREA_CODE,STREET_NAME,STREET_SHORT_NAME,STREET_LNG,STREET_LAT,SORT,CREATE_DATE,MODIFY_DATE,`DESC`,status) values
+        insert into sys_street (STREET_ID,STREET_CODE,AREA_CODE,STREET_NAME,STREET_SHORT_NAME,STREET_LNG,STREET_LAT,SORT,CREATE_DATE,MODIFY_DATE,`DESC`,status) values
         (#{streetId},#{streetCode},#{areaCode},#{streetName},#{streetShortName},#{streetLng},#{streetLat},#{sort},#{createDate},#{modifyDate},#{desc},#{status})
     </insert>
 
     <!--批量插入-->
     <insert id="insertList" parameterType="List">
-        insert into bs_street (STREET_ID,STREET_CODE,AREA_CODE,STREET_NAME,STREET_SHORT_NAME,STREET_LNG,STREET_LAT,SORT,CREATE_DATE,MODIFY_DATE,`DESC`,status) values
+        insert into sys_street (STREET_ID,STREET_CODE,AREA_CODE,STREET_NAME,STREET_SHORT_NAME,STREET_LNG,STREET_LAT,SORT,CREATE_DATE,MODIFY_DATE,`DESC`,status) values
         <foreach collection="list" item="item" index="index" separator="," >
             (#{item.streetId},#{item.streetCode},#{item.areaCode},#{item.streetName},#{item.streetShortName},#{item.streetLng},#{item.streetLat},#{item.sort},#{item.createDate},#{item.modifyDate},#{item.desc},#{item.status})
         </foreach>
     </insert>
 
     <update id="updateByPrimaryKey" parameterType="BsStreet">
-        update bs_street
+        update sys_street
         <set>
              <if test="streetCode != null">
                 STREET_CODE = #{ streetCode },
@@ -90,7 +90,7 @@
 
     <!-- 更新多个或者单个字段 -->
     <update id="updateM" parameterType="Map">
-        update bs_street set ${filed}=#{filedValue}
+        update sys_street set ${filed}=#{filedValue}
         <if test="filed2!=null and filed2!=''">,${filed2}=#{filedValue2}</if>
         <if test="filed3!=null and filed3!=''">,${filed3}=#{filedValue3}</if>
         <if test="filed4!=null and filed4!=''">,${filed4}=#{filedValue4}</if>
@@ -103,7 +103,7 @@
 
     <!--查询某个字段的某条数据数量-->
     <select id="getObjExists" parameterType="Map" resultType="int">
-        select count(1) cun from bs_street where 1=1
+        select count(1) cun from sys_street where 1=1
         <if test="key!=null and key!=''">
             and ${key} = #{value}
         </if>
@@ -119,17 +119,17 @@
 
     <select id="getMapById" resultType="Map" parameterType="String">
         select <include refid="Base_Column_List" />
-        from bs_street where STREET_ID = #{id}
+        from sys_street where STREET_ID = #{id}
     </select>
 
     <select id="getObjectById" resultMap="BaseResultMap" parameterType="String">
         select <include refid="Base_Column_List" />
-        from bs_street where STREET_ID = #{id}
+        from sys_street where STREET_ID = #{id}
     </select>
 
     <!--分页查询基础语句返回Map-->
     <select id="getPageDatas" parameterType="BsStreet" resultType="Map">
-        SELECT STREET_ID,STREET_CODE,AREA_CODE,STREET_NAME,STREET_SHORT_NAME,STREET_LNG,STREET_LAT,SORT,CREATE_DATE,MODIFY_DATE,`DESC`,status  from bs_street
+        SELECT STREET_ID,STREET_CODE,AREA_CODE,STREET_NAME,STREET_SHORT_NAME,STREET_LNG,STREET_LAT,SORT,CREATE_DATE,MODIFY_DATE,`DESC`,status  from sys_street
         where 1=1
     </select>
 
@@ -137,7 +137,7 @@
     <!--分页查询基础语句返回对象-->
     <select id="getPageListByObj" parameterType="BsStreet" resultMap="BaseResultMap">
         SELECT STREET_ID,STREET_CODE,AREA_CODE,STREET_NAME,STREET_SHORT_NAME,STREET_LNG,STREET_LAT,status
-        from bs_street
+        from sys_street
         where 1=1
         <if test="areaCode != null and areaCode!='' ">
             and AREA_CODE  = #{areaCode}

+ 5 - 1
cbkj_web_parameter/src/main/resources/mappers/drug/BStandardMatMapper.xml

@@ -66,8 +66,9 @@
         SELECT s_id,s_mat_code,s_mat_name,s_mat_class,s_mat_type
         from b_standard_mat
         <where>
+        1=1
             <if test=" sMatName != null and sMatName!='' and sMatCode != null and sMatCode!='' ">
-                and s_mat_name like CONCAT('%',trim(#{sMatName}),'%') or s_mat_code like CONCAT('%',trim(#{sMatCode}),'%')
+                and (s_mat_name like CONCAT('%',trim(#{sMatName}),'%') or s_mat_code like CONCAT('%',trim(#{sMatCode}),'%'))
             </if>
             <if test=" (sMatName != null and sMatName!='') and (sMatCode == null or sMatCode=='') ">
                 and s_mat_name like CONCAT('%',trim(#{sMatName}),'%')
@@ -75,6 +76,9 @@
             <if test=" (sMatName == null or sMatName=='') and (sMatCode != null and sMatCode!='') ">
                 and s_mat_code like CONCAT('%',trim(#{sMatCode}),'%')
             </if>
+            <if test=" sMatType == null or sMatType=='' ">
+                and s_mat_type = #{sMatCode}
+            </if>
         </where>
     </select>
 

+ 13 - 4
cbkj_web_parameter/src/main/resources/mappers/drug/TAppMaterialMappingMapper.xml

@@ -31,13 +31,13 @@
 
     <insert id="insert"  parameterType="TAppMaterialMapping">
         insert into t_app_material_mapping (<include refid="Base_Column_List" />) values
-        (#{id},#{kMatId},#{kMatName},#{drugId},#{matPriceId},#{createDate},#{createUser},#{createUsername})
+        (#{id},#{kMatId},#{kMatName},#{drugId},#{matPriceId},NOW(),#{createUser},#{createUsername})
     </insert>
 
     <insert id="insertList" parameterType="List">
         insert into t_app_material_mapping (<include refid="Base_Column_List" />) values
         <foreach collection="list" item="item" index="index" separator="," >
-            (#{item.id},#{item.kMatId},#{item.kMatName},#{item.drugId},#{item.matPriceId},#{item.createDate},#{item.createUser},#{item.createUsername})
+            (#{item.id},#{item.kMatId},#{item.kMatName},#{item.drugId},#{item.matPriceId},NOW(),#{item.createUser},#{item.createUsername})
         </foreach>
     </insert>
 
@@ -117,7 +117,7 @@
         FROM
             t_material_price AS tmp
                 JOIN t_material AS tm2 ON ( tm2.status = '1' AND tm2.is_del='0' AND tm2.mat_id = tmp.mat_id )
-                JOIN t_drug_list AS tdl ON (tm2.drug_id = tdl.drug_id )
+                JOIN t_drug_list AS tdl ON (tm2.drug_id = tdl.drug_id and tdl.drug_type='0')
                 LEFT JOIN t_app_material_mapping AS tamm ON(tamm.drug_id = tm2.drug_id AND tamm.mat_price_id = tmp.mat_price_id )
                 LEFT JOIN b_material AS bm ON(bm.k_mat_id=tamm.k_mat_id )
                 LEFT JOIN t_pharmacy AS tp ON(tdl.drug_id = tp.drug_id)
@@ -138,7 +138,16 @@
     </select>
     <select id="selectCountData" resultType="java.lang.Long" parameterType="TMaterialKnowVO">
         select count(*) from t_app_material_mapping
-where mat_price_id = #{matPriceId}
+        <where>
+            1=1
+            <if test=" matPriceId != null and matPriceId !=''">
+            and mat_price_id = #{matPriceId}
+            </if>
+            <if test=" kMatId != null and kMatId !=''">
+            and k_mat_id = #{kMatId}
+            </if>
+        </where>
+
     </select>
 
 </mapper>

+ 78 - 2
cbkj_web_parameter/src/main/resources/mappers/drug/TCenterHisMappingMapper.xml

@@ -33,15 +33,38 @@
 
     <insert id="insert"  parameterType="TCenterHisMapping">
         insert into t_center_his_mapping (<include refid="Base_Column_List" />) values
-        (#{id},#{drugId},#{matPriceId},#{drugIdHis},#{matPriceIdHis},#{type},#{createDate},#{createUser},#{createUsername},#{status})
+        (#{id},#{drugId},#{matPriceId},#{drugIdHis},#{matPriceIdHis},#{type},NOW(),#{createUser},#{createUsername},#{status})
     </insert>
 
     <insert id="insertList" parameterType="List">
         insert into t_center_his_mapping (<include refid="Base_Column_List" />) values
         <foreach collection="list" item="item" index="index" separator="," >
-            (#{item.id},#{item.drugId},#{item.matPriceId},#{item.drugIdHis},#{item.matPriceIdHis},#{item.type},#{item.createDate},#{item.createUser},#{item.createUsername},#{item.status})
+            (#{item.id},#{item.drugId},#{item.matPriceId},#{item.drugIdHis},#{item.matPriceIdHis},#{item.type},NOW(),#{item.createUser},#{item.createUsername},#{item.status})
         </foreach>
     </insert>
+    <insert id="insertautoMapping" parameterType="StandTMAutoMappingVO">
+        INSERT INTO t_app_material_mapping
+        SELECT rand_string(32),
+               tm2.drug_id,
+               tmp.mat_price_id,
+               m.drug_id as drug_id_his,
+               tmp2.mat_price_id AS mat_price_id_his,
+               '1',
+               NOW(),
+               #{createUser},
+               #{createUserName},
+               '1'
+        FROM t_material_price tmp
+                 JOIN t_material AS tm2 ON (tm2.status = '1' AND tm2.is_del = '0' AND tm2.mat_id = tmp.mat_id)
+                 left join t_material_price as tmp2 on(1=1)
+            LEFT JOIN t_material m ON (
+            tmp2.mat_id=m.mat_id and m.status='1' and m.is_del='0' and
+            m.mat_name = substring_index(substring_index(substring_index(substring_index(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(REPLACE(tm2.mat_name,'【配送】',''),'5',''),'1',''),'*',''),'d',''),'K',''),'G',''),'P',''),'Z',''),'配方颗粒',''),'颗粒',''),'(',1),'(',1),'[',1),'&lt;',1)
+            )
+            left join t_drug_list as tdl on( tdl.drug_id=m.drug_id and tdl.drug_type='1' )
+            LEFT JOIN t_center_his_mapping p ON p.mat_price_id = tmp.mat_price_id
+        WHERE  tm2.drug_id = #{drugId} AND p.mat_price_id IS NULL AND m.mat_id IS NOT NULL
+    </insert>
 
     <update id="updateByPrimaryKey" parameterType="TCenterHisMapping">
         update t_center_his_mapping
@@ -91,5 +114,58 @@
             </if>
         </where>
     </select>
+    <resultMap id="BaseResultMap2" type="com.jiuzhekan.cbkj.beans.drug.TMaterialHISVO">
+        <id column="matId" jdbcType="VARCHAR"  property="matId" />
+    </resultMap>
+
+    <select id="getPageDatas2" resultType="TMaterialHISVO" resultMap="BaseResultMap2">
+        SELECT
+            tm2.mat_id matId,
+            tm2.mat_name matName,
+            tm2.mat_standard matStandard,
+            tm2.drug_id drugId,
+            tmp.mat_price_id as matPriceId,
+            tm22.mat_id matIdHis,
+            tm22.mat_name matNameHis,
+            tm22.mat_standard matStandardHis,
+            tm22.drug_id drugIdHis,
+            tmp11.mat_price_id as matPriceIdHis
+        FROM
+                t_material_price AS tmp
+                JOIN t_material AS tm2 ON ( tm2.status = '1' AND tm2.is_del='0' AND tm2.mat_id = tmp.mat_id )
+                JOIN t_drug_list AS tdl ON (tm2.drug_id = tdl.drug_id and tdl.drug_type='0')
+                LEFT JOIN t_center_his_mapping AS tchm ON(tchm.drug_id = tm2.drug_id AND tchm.mat_price_id = tmp.mat_price_id )
+            left join t_material_price AS tmp11 on (tmp11.status='1' and tmp11.mat_id=tchm.drug_id_his and tmp11.mat_price_id=tchm.mat_price_id_his)
+            left JOIN t_material AS tm22 ON ( tm22.status = '1' AND tm22.is_del='0' AND tm22.mat_id = tmp11.mat_id )
+            left JOIN t_drug_list AS tdl11 ON (tm22.drug_id = tdl11.drug_id and tdl11.drug_type='1')
+            LEFT JOIN t_pharmacy AS tp ON(tdl.drug_id = tp.drug_id)
+        where tmp.status='1'
+        <if test=" isMapping == 1">
+            and tm22.k_mat_id is not null
+        </if>
+        <if test=" isMapping == 2">
+            and tm22.k_mat_id is null
+        </if>
+        <if test=" phaType != null and phaType !=''">
+            and tp.pha_type =#{phaType}
+        </if>
+        <if test=" keyWord != null and keyWord !=''">
+            and (tm2.mat_name like CONCAT('%',trim(#{keyWord}),'%') or tm2.mat_standard like CONCAT('%',trim(#{keyWord}),'%') )
+        </if>
+        GROUP BY tmp.mat_id
+    </select>
+    <select id="selectCountData" resultType="java.lang.Long" parameterType="TMaterialHISVO">
+        SELECT count(*)
+        from t_center_his_mapping
+<where>
+1=1
+    <if test="matPriceId != null and matPriceId !='' ">
+        and mat_price_id = #{matPriceId}
+    </if>
+    <if test="matPriceIdHis != null and matPriceIdHis !='' ">
+    and mat_price_id_his = #{matPriceIdHis}
+    </if>
+</where>
+    </select>
 
 </mapper>

+ 4 - 4
cbkj_web_parameter/src/main/resources/mappers/drug/TStandardMaterialMappingMapper.xml

@@ -33,13 +33,13 @@
 
     <insert id="insert"  parameterType="TStandardMaterialMapping">
         insert into t_standard_material_mapping (<include refid="Base_Column_List" />) values
-        (#{id},#{sId},#{sMatName},#{sMatCode},#{sMatType},#{drugId},#{matId},#{createDate},#{createUser},#{createUserName})
+        (#{id},#{sId},#{sMatName},#{sMatCode},#{sMatType},#{drugId},#{matId},NOW(),#{createUser},#{createUserName})
     </insert>
 
     <insert id="insertList" parameterType="List">
         insert into t_standard_material_mapping (<include refid="Base_Column_List" />) values
         <foreach collection="list" item="item" index="index" separator="," >
-            (#{item.id},#{item.sId},#{item.sMatName},#{item.sMatCode},#{item.sMatType},#{item.drugId},#{item.matId},#{item.createDate},#{item.createUser},#{item.createUserName})
+            (#{item.id},#{item.sId},#{item.sMatName},#{item.sMatCode},#{item.sMatType},#{item.drugId},#{item.matId},NOW(),#{item.createUser},#{item.createUserName})
         </foreach>
     </insert>
 
@@ -106,7 +106,7 @@
         LEFT JOIN t_standard_material_mapping AS tsmm ON(tsmm.drug_id = tm2.drug_id AND tsmm.mat_id = tm2.mat_id AND tsmm.s_mat_type='2')
         LEFT JOIN b_standard_mat AS bsm ON(bsm.s_id=tsmm.s_id AND bsm.s_mat_type='2')
         <where>
-            tdl.status='1'
+            tdl.status='1' and tdl.drug_type='0'
             <if test=" isMapping == 1">
                  and bsm.s_id is not null
             </if>
@@ -155,7 +155,7 @@ group by tm2.mat_id
                #{createUser},
                #{createUserName}
         FROM t_material mx
-                 LEFT JOIN b_standard_mat m ON m.s_mat_name = substring_index(substring_index(substring_index(substring_index(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(REPLACE(mx.mat_name,'【配送】',''),'5',''),'1',''),'*',''),'d',''),'K',''),'G',''),'P',''),'Z',''),'配方颗粒',''),'颗粒',''),'(',1),'(',1),'[',1),'&lt;',1)
+                 LEFT JOIN b_standard_mat m ON  m.s_mat_type='2' and m.s_mat_name = substring_index(substring_index(substring_index(substring_index(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(REPLACE(mx.mat_name,'【配送】',''),'5',''),'1',''),'*',''),'d',''),'K',''),'G',''),'P',''),'Z',''),'配方颗粒',''),'颗粒',''),'(',1),'(',1),'[',1),'&lt;',1)
                  LEFT JOIN t_standard_material_mapping p ON p.mat_id = mx.mat_id
         WHERE mx.is_del = '0' and mx.drug_id = #{drugId} AND p.mat_id IS NULL AND m.s_id IS NOT NULL