123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261 |
- <?xml version="1.0" encoding="UTF-8" ?>
- <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
- <mapper namespace="com.xinxin.topro.pubservice.mysqlmapper.DicWardMapper" >
- <resultMap id="BaseResultMap" type="com.xinxin.topro.pubservice.mysqlModel.DicWard" >
- <id column="DW_ID" property="dwId" jdbcType="INTEGER" />
- <result column="HI_ID" property="hiId" jdbcType="INTEGER" />
- <result column="DW_WardDm" property="dwWarddm" jdbcType="VARCHAR" />
- <result column="DW_WardName" property="dwWardname" jdbcType="VARCHAR" />
- <result column="DW_PinyinCode" property="dwPinyincode" jdbcType="VARCHAR" />
- <result column="DW_WubiCode" property="dwWubicode" jdbcType="VARCHAR" />
- <result column="DW_OtherCode" property="dwOthercode" jdbcType="VARCHAR" />
- <result column="UI_ID" property="uiId" jdbcType="VARCHAR" />
- <result column="DW_Date" property="dwDate" jdbcType="TIMESTAMP" />
- <result column="DW_Type" property="dwType" jdbcType="INTEGER" />
- <result column="DW_EngName" property="dwEngname" jdbcType="VARCHAR" />
- <result column="DW_MaxBed" property="dwMaxbed" jdbcType="INTEGER" />
- <result column="DW_Sord" property="dwSord" jdbcType="INTEGER" />
- <result column="DW_IsDel" property="dwIsdel" jdbcType="INTEGER" />
- </resultMap>
- <resultMap id="DeptResultMap" type="com.xinxin.topro.pubservice.sqlservermodel.Depart" >
- <result column="DivCode" property="departno" jdbcType="VARCHAR" />
- <result column="DivName" property="departname" jdbcType="VARCHAR" />
- </resultMap>
- <sql id="Base_Column_List" >
- DW_ID, HI_ID, DW_WardDm, DW_WardName, DW_PinyinCode, DW_WubiCode, DW_OtherCode, UI_ID,
- DW_Date, DW_Type, DW_EngName, DW_MaxBed, DW_Sord, DW_IsDel
- </sql>
- <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
- select
- <include refid="Base_Column_List" />
- from dic_ward
- where DW_ID = #{dwId,jdbcType=INTEGER}
- </select>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
- delete from dic_ward
- where DW_ID = #{dwId,jdbcType=INTEGER}
- </delete>
- <insert id="insert" parameterType="com.xinxin.topro.pubservice.mysqlModel.DicWard" >
- insert into dic_ward (DW_ID, HI_ID, DW_WardDm,
- DW_WardName, DW_PinyinCode, DW_WubiCode,
- DW_OtherCode, UI_ID, DW_Date,
- DW_Type, DW_EngName, DW_MaxBed,
- DW_Sord, DW_IsDel)
- values (#{dwId,jdbcType=INTEGER}, #{hiId,jdbcType=INTEGER}, #{dwWarddm,jdbcType=VARCHAR},
- #{dwWardname,jdbcType=VARCHAR}, #{dwPinyincode,jdbcType=VARCHAR}, #{dwWubicode,jdbcType=VARCHAR},
- #{dwOthercode,jdbcType=VARCHAR}, #{uiId,jdbcType=VARCHAR}, #{dwDate,jdbcType=TIMESTAMP},
- #{dwType,jdbcType=INTEGER}, #{dwEngname,jdbcType=VARCHAR}, #{dwMaxbed,jdbcType=INTEGER},
- #{dwSord,jdbcType=INTEGER}, #{dwIsdel,jdbcType=INTEGER})
- </insert>
- <insert id="insertSelective" parameterType="com.xinxin.topro.pubservice.mysqlModel.DicWard" >
- insert into dic_ward
- <trim prefix="(" suffix=")" suffixOverrides="," >
- <if test="dwId != null" >
- DW_ID,
- </if>
- <if test="hiId != null" >
- HI_ID,
- </if>
- <if test="dwWarddm != null" >
- DW_WardDm,
- </if>
- <if test="dwWardname != null" >
- DW_WardName,
- </if>
- <if test="dwPinyincode != null" >
- DW_PinyinCode,
- </if>
- <if test="dwWubicode != null" >
- DW_WubiCode,
- </if>
- <if test="dwOthercode != null" >
- DW_OtherCode,
- </if>
- <if test="uiId != null" >
- UI_ID,
- </if>
- <if test="dwDate != null" >
- DW_Date,
- </if>
- <if test="dwType != null" >
- DW_Type,
- </if>
- <if test="dwEngname != null" >
- DW_EngName,
- </if>
- <if test="dwMaxbed != null" >
- DW_MaxBed,
- </if>
- <if test="dwSord != null" >
- DW_Sord,
- </if>
- <if test="dwIsdel != null" >
- DW_IsDel,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides="," >
- <if test="dwId != null" >
- #{dwId,jdbcType=INTEGER},
- </if>
- <if test="hiId != null" >
- #{hiId,jdbcType=INTEGER},
- </if>
- <if test="dwWarddm != null" >
- #{dwWarddm,jdbcType=VARCHAR},
- </if>
- <if test="dwWardname != null" >
- #{dwWardname,jdbcType=VARCHAR},
- </if>
- <if test="dwPinyincode != null" >
- #{dwPinyincode,jdbcType=VARCHAR},
- </if>
- <if test="dwWubicode != null" >
- #{dwWubicode,jdbcType=VARCHAR},
- </if>
- <if test="dwOthercode != null" >
- #{dwOthercode,jdbcType=VARCHAR},
- </if>
- <if test="uiId != null" >
- #{uiId,jdbcType=VARCHAR},
- </if>
- <if test="dwDate != null" >
- #{dwDate,jdbcType=TIMESTAMP},
- </if>
- <if test="dwType != null" >
- #{dwType,jdbcType=INTEGER},
- </if>
- <if test="dwEngname != null" >
- #{dwEngname,jdbcType=VARCHAR},
- </if>
- <if test="dwMaxbed != null" >
- #{dwMaxbed,jdbcType=INTEGER},
- </if>
- <if test="dwSord != null" >
- #{dwSord,jdbcType=INTEGER},
- </if>
- <if test="dwIsdel != null" >
- #{dwIsdel,jdbcType=INTEGER},
- </if>
- </trim>
- </insert>
- <update id="updateByPrimaryKeySelective" parameterType="com.xinxin.topro.pubservice.mysqlModel.DicWard" >
- update dic_ward
- <set >
- <if test="hiId != null" >
- HI_ID = #{hiId,jdbcType=INTEGER},
- </if>
- <if test="dwWarddm != null" >
- DW_WardDm = #{dwWarddm,jdbcType=VARCHAR},
- </if>
- <if test="dwWardname != null" >
- DW_WardName = #{dwWardname,jdbcType=VARCHAR},
- </if>
- <if test="dwPinyincode != null" >
- DW_PinyinCode = #{dwPinyincode,jdbcType=VARCHAR},
- </if>
- <if test="dwWubicode != null" >
- DW_WubiCode = #{dwWubicode,jdbcType=VARCHAR},
- </if>
- <if test="dwOthercode != null" >
- DW_OtherCode = #{dwOthercode,jdbcType=VARCHAR},
- </if>
- <if test="uiId != null" >
- UI_ID = #{uiId,jdbcType=VARCHAR},
- </if>
- <if test="dwDate != null" >
- DW_Date = #{dwDate,jdbcType=TIMESTAMP},
- </if>
- <if test="dwType != null" >
- DW_Type = #{dwType,jdbcType=INTEGER},
- </if>
- <if test="dwEngname != null" >
- DW_EngName = #{dwEngname,jdbcType=VARCHAR},
- </if>
- <if test="dwMaxbed != null" >
- DW_MaxBed = #{dwMaxbed,jdbcType=INTEGER},
- </if>
- <if test="dwSord != null" >
- DW_Sord = #{dwSord,jdbcType=INTEGER},
- </if>
- <if test="dwIsdel != null" >
- DW_IsDel = #{dwIsdel,jdbcType=INTEGER},
- </if>
- </set>
- where DW_ID = #{dwId,jdbcType=INTEGER}
- </update>
- <update id="updateByPrimaryKey" parameterType="com.xinxin.topro.pubservice.mysqlModel.DicWard" >
- update dic_ward
- set HI_ID = #{hiId,jdbcType=INTEGER},
- DW_WardDm = #{dwWarddm,jdbcType=VARCHAR},
- DW_WardName = #{dwWardname,jdbcType=VARCHAR},
- DW_PinyinCode = #{dwPinyincode,jdbcType=VARCHAR},
- DW_WubiCode = #{dwWubicode,jdbcType=VARCHAR},
- DW_OtherCode = #{dwOthercode,jdbcType=VARCHAR},
- UI_ID = #{uiId,jdbcType=VARCHAR},
- DW_Date = #{dwDate,jdbcType=TIMESTAMP},
- DW_Type = #{dwType,jdbcType=INTEGER},
- DW_EngName = #{dwEngname,jdbcType=VARCHAR},
- DW_MaxBed = #{dwMaxbed,jdbcType=INTEGER},
- DW_Sord = #{dwSord,jdbcType=INTEGER},
- DW_IsDel = #{dwIsdel,jdbcType=INTEGER}
- where DW_ID = #{dwId,jdbcType=INTEGER}
- </update>
- <select id="selectAllDivision" resultMap="DeptResultMap">
- select
- DD_DepDm departno , DD_DepName departname
- from dic_department
- </select>
- <select id="selectAllWards" resultMap="DeptResultMap">
- select
- DW_WardDm departno , DW_WardName departname
- from dic_ward
- </select>
- <select id="selectAuthorityWards" resultMap="DeptResultMap" >
- SELECT a.DW_WardDm departno,b.DW_WardName departname,a.SWP_IsDefault isDefault FROM sys_ward_permission a
- INNER JOIN dic_ward b on a.DW_WardDm = b.DW_WardDm and a.HI_ID = b.HI_ID
- where UI_Code = #{userCode,jdbcType=VARCHAR}
- and a.SWP_IsDel = 0 and b.DW_IsDel = 0
- <if test="hiid != null" >
- and a.HI_ID = #{hiid,jdbcType=INTEGER}
- </if>
- </select>
- <select id="selectAuthorityDivisions" resultMap="DeptResultMap" parameterType="java.lang.String" >
- SELECT a.DW_WardDm departno,b.DW_WardName departname FROM sys_ward_permission a
- INNER JOIN dic_ward b on a.DW_WardDm = b.DW_WardDm
- where UI_Code = #{userCode,jdbcType=VARCHAR}
- </select>
- <select id="selectEffectiveDeparts" resultMap="DeptResultMap" parameterType="java.lang.String" >
- select
- DD_DepDm departno , DD_DepName departname
- from dic_department WHERE DD_DepDm in (SELECT DD_DepDm from inp_patient WHERE DW_WardDm = #{departNo,jdbcType=VARCHAR} and IP_Status = #{status,jdbcType=VARCHAR} GROUP BY DD_DepDm)
- </select>
- <select id="selectAllWardsByHiId" resultMap="DeptResultMap">
- select
- DW_WardDm departno , DW_WardName departname
- from dic_ward
- where HI_ID = #{hiId,jdbcType=INTEGER}
- </select>
- <select id="selectAllHiId" resultMap="BaseResultMap">
- select
- <include refid="Base_Column_List" />
- from dic_ward
- where HI_ID in
- <foreach collection="list" item="item" separator="," index="index" open="(" close=")">
- #{item,jdbcType=INTEGER}
- </foreach>
- </select>
- <select id="selectAllWard" resultMap="BaseResultMap">
- select
- DW_WardDm, DW_WardName
- from dic_ward
- where DW_WardDm in
- <foreach collection="list" item="item" separator="," index="index" open="(" close=")">
- #{item,jdbcType=INTEGER}
- </foreach>
- </select>
- </mapper>
|