123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313 |
- <?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.sqlservermapper.DivisionMapper" >
- <resultMap id="BaseResultMap" type="com.xinxin.topro.pubservice.sqlservermodel.Division" >
- <id column="DivNo" property="divno" jdbcType="VARCHAR" />
- <result column="DivCode" property="divcode" jdbcType="VARCHAR" />
- <result column="DivName" property="divname" jdbcType="VARCHAR" />
- <result column="DivEngName" property="divengname" jdbcType="VARCHAR" />
- <result column="DeptNo" property="deptno" jdbcType="VARCHAR" />
- <result column="IsVirtual" property="isvirtual" jdbcType="BIT" />
- <result column="IsConsultation" property="isconsultation" jdbcType="BIT" />
- <result column="DivType" property="divtype" jdbcType="VARCHAR" />
- <result column="UpdateUser" property="updateuser" jdbcType="VARCHAR" />
- <result column="UpdateTime" property="updatetime" jdbcType="TIMESTAMP" />
- <result column="Keyword1" property="keyword1" jdbcType="VARCHAR" />
- <result column="Keyword2" property="keyword2" jdbcType="VARCHAR" />
- <result column="Keyword3" property="keyword3" jdbcType="VARCHAR" />
- <result column="IsIss" property="isiss" jdbcType="INTEGER" />
- <result column="OpdUseType" property="opdusetype" jdbcType="VARCHAR" />
- <result column="InpUseType" property="inpusetype" jdbcType="VARCHAR" />
- <result column="EmgUseType" property="emgusetype" jdbcType="VARCHAR" />
- <result column="Zone" property="zone" jdbcType="VARCHAR" />
- <result column="OpdDrugDays" property="opddrugdays" jdbcType="INTEGER" />
- <result column="MedDivNo" property="meddivno" jdbcType="VARCHAR" />
- </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" >
- DivNo, DivCode, DivName, DivEngName, DeptNo, IsVirtual, IsConsultation, DivType,
- UpdateUser, UpdateTime, Keyword1, Keyword2, Keyword3, IsIss, OpdUseType, InpUseType,
- EmgUseType, Zone, OpdDrugDays, MedDivNo
- </sql>
- <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
- select
- <include refid="Base_Column_List" />
- from Division
- where DivNo = #{divno,jdbcType=VARCHAR}
- </select>
- <select id="selectAuthorityDivisions" resultMap="DeptResultMap" parameterType="java.lang.String" >
- select DISTINCT
- DivNo departno ,DivDepartName departname
- from EmpDivision a INNER JOIN Employee b on a.empno = b.empno where a.DivDepartFlag = '科室' and EmpCode = #{userCode,jdbcType=VARCHAR}
- </select>
- <select id="selectAllDivision" resultMap="DeptResultMap">
- select
- DivNo departno , divName departname
- from Division
- </select>
- <select id="selectAuthorityWards" resultMap="DeptResultMap" parameterType="java.lang.String" >
- select DISTINCT
- DivNo departno ,DivDepartName departname
- from EmpDivision a INNER JOIN Employee b on a.empno = b.empno where a.DivDepartFlag = '病区' and EmpCode = #{userCode,jdbcType=VARCHAR}
- </select>
- <select id="selectAllWards" resultMap="DeptResultMap">
- select
- departno , departname
- from V_WARD
- </select>
- <select id="selectEffectiveDeparts" resultMap="DeptResultMap" parameterType="java.lang.String" >
- select
- DivNo departno , divName departname
- from Division WHERE DivNo in (SELECT DivNo from InPatient WHERE departNo = #{departNo,jdbcType=VARCHAR} and inHospitalStatus = #{status,jdbcType=VARCHAR} GROUP BY DivNo)
- </select>
- <select id="selectAll" resultMap="DeptResultMap" parameterType="java.lang.String" >
- select
- departno , departname
- from Depart
- </select>
- <select id="selectByName" resultMap="DeptResultMap" parameterType="java.lang.String" >
- select
- departno , departname
- from Depart where departName like CONCAT(#{departName,jdbcType=VARCHAR},'%')
- </select>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
- delete from Division
- where DivNo = #{divno,jdbcType=VARCHAR}
- </delete>
- <insert id="insert" parameterType="com.xinxin.topro.pubservice.sqlservermodel.Division" >
- insert into Division (DivNo, DivCode, DivName,
- DivEngName, DeptNo, IsVirtual,
- IsConsultation, DivType, UpdateUser,
- UpdateTime, Keyword1, Keyword2,
- Keyword3, IsIss, OpdUseType,
- InpUseType, EmgUseType, Zone,
- OpdDrugDays, MedDivNo)
- values (#{divno,jdbcType=VARCHAR}, #{divcode,jdbcType=VARCHAR}, #{divname,jdbcType=VARCHAR},
- #{divengname,jdbcType=VARCHAR}, #{deptno,jdbcType=VARCHAR}, #{isvirtual,jdbcType=BIT},
- #{isconsultation,jdbcType=BIT}, #{divtype,jdbcType=VARCHAR}, #{updateuser,jdbcType=VARCHAR},
- #{updatetime,jdbcType=TIMESTAMP}, #{keyword1,jdbcType=VARCHAR}, #{keyword2,jdbcType=VARCHAR},
- #{keyword3,jdbcType=VARCHAR}, #{isiss,jdbcType=INTEGER}, #{opdusetype,jdbcType=VARCHAR},
- #{inpusetype,jdbcType=VARCHAR}, #{emgusetype,jdbcType=VARCHAR}, #{zone,jdbcType=VARCHAR},
- #{opddrugdays,jdbcType=INTEGER}, #{meddivno,jdbcType=VARCHAR})
- </insert>
- <insert id="insertSelective" parameterType="com.xinxin.topro.pubservice.sqlservermodel.Division" >
- insert into Division
- <trim prefix="(" suffix=")" suffixOverrides="," >
- <if test="divno != null" >
- DivNo,
- </if>
- <if test="divcode != null" >
- DivCode,
- </if>
- <if test="divname != null" >
- DivName,
- </if>
- <if test="divengname != null" >
- DivEngName,
- </if>
- <if test="deptno != null" >
- DeptNo,
- </if>
- <if test="isvirtual != null" >
- IsVirtual,
- </if>
- <if test="isconsultation != null" >
- IsConsultation,
- </if>
- <if test="divtype != null" >
- DivType,
- </if>
- <if test="updateuser != null" >
- UpdateUser,
- </if>
- <if test="updatetime != null" >
- UpdateTime,
- </if>
- <if test="keyword1 != null" >
- Keyword1,
- </if>
- <if test="keyword2 != null" >
- Keyword2,
- </if>
- <if test="keyword3 != null" >
- Keyword3,
- </if>
- <if test="isiss != null" >
- IsIss,
- </if>
- <if test="opdusetype != null" >
- OpdUseType,
- </if>
- <if test="inpusetype != null" >
- InpUseType,
- </if>
- <if test="emgusetype != null" >
- EmgUseType,
- </if>
- <if test="zone != null" >
- Zone,
- </if>
- <if test="opddrugdays != null" >
- OpdDrugDays,
- </if>
- <if test="meddivno != null" >
- MedDivNo,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides="," >
- <if test="divno != null" >
- #{divno,jdbcType=VARCHAR},
- </if>
- <if test="divcode != null" >
- #{divcode,jdbcType=VARCHAR},
- </if>
- <if test="divname != null" >
- #{divname,jdbcType=VARCHAR},
- </if>
- <if test="divengname != null" >
- #{divengname,jdbcType=VARCHAR},
- </if>
- <if test="deptno != null" >
- #{deptno,jdbcType=VARCHAR},
- </if>
- <if test="isvirtual != null" >
- #{isvirtual,jdbcType=BIT},
- </if>
- <if test="isconsultation != null" >
- #{isconsultation,jdbcType=BIT},
- </if>
- <if test="divtype != null" >
- #{divtype,jdbcType=VARCHAR},
- </if>
- <if test="updateuser != null" >
- #{updateuser,jdbcType=VARCHAR},
- </if>
- <if test="updatetime != null" >
- #{updatetime,jdbcType=TIMESTAMP},
- </if>
- <if test="keyword1 != null" >
- #{keyword1,jdbcType=VARCHAR},
- </if>
- <if test="keyword2 != null" >
- #{keyword2,jdbcType=VARCHAR},
- </if>
- <if test="keyword3 != null" >
- #{keyword3,jdbcType=VARCHAR},
- </if>
- <if test="isiss != null" >
- #{isiss,jdbcType=INTEGER},
- </if>
- <if test="opdusetype != null" >
- #{opdusetype,jdbcType=VARCHAR},
- </if>
- <if test="inpusetype != null" >
- #{inpusetype,jdbcType=VARCHAR},
- </if>
- <if test="emgusetype != null" >
- #{emgusetype,jdbcType=VARCHAR},
- </if>
- <if test="zone != null" >
- #{zone,jdbcType=VARCHAR},
- </if>
- <if test="opddrugdays != null" >
- #{opddrugdays,jdbcType=INTEGER},
- </if>
- <if test="meddivno != null" >
- #{meddivno,jdbcType=VARCHAR},
- </if>
- </trim>
- </insert>
- <update id="updateByPrimaryKeySelective" parameterType="com.xinxin.topro.pubservice.sqlservermodel.Division" >
- update Division
- <set >
- <if test="divcode != null" >
- DivCode = #{divcode,jdbcType=VARCHAR},
- </if>
- <if test="divname != null" >
- DivName = #{divname,jdbcType=VARCHAR},
- </if>
- <if test="divengname != null" >
- DivEngName = #{divengname,jdbcType=VARCHAR},
- </if>
- <if test="deptno != null" >
- DeptNo = #{deptno,jdbcType=VARCHAR},
- </if>
- <if test="isvirtual != null" >
- IsVirtual = #{isvirtual,jdbcType=BIT},
- </if>
- <if test="isconsultation != null" >
- IsConsultation = #{isconsultation,jdbcType=BIT},
- </if>
- <if test="divtype != null" >
- DivType = #{divtype,jdbcType=VARCHAR},
- </if>
- <if test="updateuser != null" >
- UpdateUser = #{updateuser,jdbcType=VARCHAR},
- </if>
- <if test="updatetime != null" >
- UpdateTime = #{updatetime,jdbcType=TIMESTAMP},
- </if>
- <if test="keyword1 != null" >
- Keyword1 = #{keyword1,jdbcType=VARCHAR},
- </if>
- <if test="keyword2 != null" >
- Keyword2 = #{keyword2,jdbcType=VARCHAR},
- </if>
- <if test="keyword3 != null" >
- Keyword3 = #{keyword3,jdbcType=VARCHAR},
- </if>
- <if test="isiss != null" >
- IsIss = #{isiss,jdbcType=INTEGER},
- </if>
- <if test="opdusetype != null" >
- OpdUseType = #{opdusetype,jdbcType=VARCHAR},
- </if>
- <if test="inpusetype != null" >
- InpUseType = #{inpusetype,jdbcType=VARCHAR},
- </if>
- <if test="emgusetype != null" >
- EmgUseType = #{emgusetype,jdbcType=VARCHAR},
- </if>
- <if test="zone != null" >
- Zone = #{zone,jdbcType=VARCHAR},
- </if>
- <if test="opddrugdays != null" >
- OpdDrugDays = #{opddrugdays,jdbcType=INTEGER},
- </if>
- <if test="meddivno != null" >
- MedDivNo = #{meddivno,jdbcType=VARCHAR},
- </if>
- </set>
- where DivNo = #{divno,jdbcType=VARCHAR}
- </update>
- <update id="updateByPrimaryKey" parameterType="com.xinxin.topro.pubservice.sqlservermodel.Division" >
- update Division
- set DivCode = #{divcode,jdbcType=VARCHAR},
- DivName = #{divname,jdbcType=VARCHAR},
- DivEngName = #{divengname,jdbcType=VARCHAR},
- DeptNo = #{deptno,jdbcType=VARCHAR},
- IsVirtual = #{isvirtual,jdbcType=BIT},
- IsConsultation = #{isconsultation,jdbcType=BIT},
- DivType = #{divtype,jdbcType=VARCHAR},
- UpdateUser = #{updateuser,jdbcType=VARCHAR},
- UpdateTime = #{updatetime,jdbcType=TIMESTAMP},
- Keyword1 = #{keyword1,jdbcType=VARCHAR},
- Keyword2 = #{keyword2,jdbcType=VARCHAR},
- Keyword3 = #{keyword3,jdbcType=VARCHAR},
- IsIss = #{isiss,jdbcType=INTEGER},
- OpdUseType = #{opdusetype,jdbcType=VARCHAR},
- InpUseType = #{inpusetype,jdbcType=VARCHAR},
- EmgUseType = #{emgusetype,jdbcType=VARCHAR},
- Zone = #{zone,jdbcType=VARCHAR},
- OpdDrugDays = #{opddrugdays,jdbcType=INTEGER},
- MedDivNo = #{meddivno,jdbcType=VARCHAR}
- where DivNo = #{divno,jdbcType=VARCHAR}
- </update>
- </mapper>
|