123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127 |
- <?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.inpnurseservice.mysqlmapper.DicTemplateMapper" >
- <resultMap id="BaseResultMap" type="com.xinxin.topro.inpnurseservice.mysqlmodel.DicTemplate" >
- <id column="DT_ID" property="dtId" jdbcType="INTEGER" />
- <result column="HI_ID" property="hiId" jdbcType="INTEGER" />
- <result column="DT_Name" property="dtName" jdbcType="VARCHAR" />
- <result column="DT_Model" property="dtModel" jdbcType="INTEGER" />
- <result column="DT_PinyinCode" property="dtPinyincode" jdbcType="VARCHAR" />
- <result column="DT_WubiCode" property="dtWubicode" jdbcType="VARCHAR" />
- <result column="DT_OtherCode" property="dtOthercode" jdbcType="VARCHAR" />
- <result column="DT_Sort" property="dtSort" jdbcType="INTEGER" />
- <result column="DD_DepDm" property="ddDepdm" jdbcType="VARCHAR" />
- <result column="DW_WardDm" property="dwWarddm" jdbcType="VARCHAR" />
- <result column="DT_Recordor" property="dtRecordor" jdbcType="VARCHAR" />
- <result column="DT_Record_Time" property="dtRecordTime" jdbcType="TIMESTAMP" />
- <result column="DT_SupID" property="dtSupid" jdbcType="INTEGER" />
- <result column="DT_IsDel" property="dtIsdel" jdbcType="INTEGER" />
- <result column="DT_Content" property="dtContent" jdbcType="LONGVARCHAR" />
- </resultMap>
- <sql id="Base_Column_List" >
- DT_ID, HI_ID, DT_Name, DT_Model, DT_PinyinCode, DT_WubiCode, DT_OtherCode, DT_Sort,
- DD_DepDm, DW_WardDm, DT_Recordor, DT_Record_Time, DT_SupID, DT_IsDel, DT_Content
- </sql>
- <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
- select
- <include refid="Base_Column_List" />
- from dic_template
- where DT_ID = #{dtId,jdbcType=INTEGER}
- and DT_IsDel = 0
- </select>
- <update id="deleteByDtId" >
- update dic_template set
- DT_IsDel = -1,
- DT_Recordor = #{dtRecordor,jdbcType=VARCHAR},
- DT_Record_Time = now()
- where DT_ID = #{dtId,jdbcType=INTEGER}
- </update>
- <insert id="insert" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.DicTemplate" useGeneratedKeys="true" keyProperty="dtId">
- insert into dic_template (HI_ID, DT_Name,
- DT_Model, DT_PinyinCode, DT_WubiCode,
- DT_OtherCode, DT_Sort, DD_DepDm,
- DW_WardDm, DT_Recordor, DT_Record_Time,
- DT_SupID, DT_IsDel, DT_Content
- )
- values (#{hiId,jdbcType=INTEGER}, #{dtName,jdbcType=VARCHAR},
- #{dtModel,jdbcType=INTEGER}, #{dtPinyincode,jdbcType=VARCHAR}, #{dtWubicode,jdbcType=VARCHAR},
- #{dtOthercode,jdbcType=VARCHAR}, #{dtSort,jdbcType=INTEGER}, #{ddDepdm,jdbcType=VARCHAR},
- #{dwWarddm,jdbcType=VARCHAR}, #{dtRecordor,jdbcType=VARCHAR}, now(),
- #{dtSupid,jdbcType=INTEGER}, 0, #{dtContent,jdbcType=LONGVARCHAR}
- )
- </insert>
- <update id="updateByPrimaryKeySelective" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.DicTemplate" >
- update dic_template
- <set >
- <if test="hiId != null" >
- HI_ID = #{hiId,jdbcType=INTEGER},
- </if>
- <if test="dtName != null" >
- DT_Name = #{dtName,jdbcType=VARCHAR},
- </if>
- <if test="dtModel != null" >
- DT_Model = #{dtModel,jdbcType=INTEGER},
- </if>
- <if test="dtPinyincode != null" >
- DT_PinyinCode = #{dtPinyincode,jdbcType=VARCHAR},
- </if>
- <if test="dtWubicode != null" >
- DT_WubiCode = #{dtWubicode,jdbcType=VARCHAR},
- </if>
- <if test="dtOthercode != null" >
- DT_OtherCode = #{dtOthercode,jdbcType=VARCHAR},
- </if>
- <if test="dtSort != null" >
- DT_Sort = #{dtSort,jdbcType=INTEGER},
- </if>
- <if test="ddDepdm != null" >
- DD_DepDm = #{ddDepdm,jdbcType=VARCHAR},
- </if>
- <if test="dwWarddm != null" >
- DW_WardDm = #{dwWarddm,jdbcType=VARCHAR},
- </if>
- <if test="dtRecordor != null" >
- DT_Recordor = #{dtRecordor,jdbcType=VARCHAR},
- </if>
- <if test="dtIsdel != null" >
- DT_IsDel = #{dtIsdel,jdbcType=INTEGER},
- </if>
- <if test="dtContent != null" >
- DT_Content = #{dtContent,jdbcType=LONGVARCHAR},
- </if>
- DT_Record_Time = now(),
- DT_SupID = #{dtSupid,jdbcType=INTEGER}
- </set>
- where DT_ID = #{dtId,jdbcType=INTEGER}
- </update>
- <select id="selectByHiIdModel" resultMap="BaseResultMap">
- select <include refid="Base_Column_List" />
- from dic_template
- where DT_IsDel = 0
- and DT_Model = #{dtModel,jdbcType=INTEGER}
- and HI_ID = #{hiId,jdbcType=INTEGER}
- <if test="dwWarddm != null" >
- and DW_WardDm = #{dwWarddm,jdbcType=VARCHAR}
- </if>
- <if test="dtRecordor != null" >
- and DT_Recordor = #{dtRecordor,jdbcType=VARCHAR}
- </if>
- order by DT_Sort
- </select>
- <select id="countChildById" resultType="java.lang.Integer">
- select count(1)
- from dic_template
- where DT_IsDel = 0
- and DT_SupID = #{dtId,jdbcType=INTEGER}
- </select>
- <update id="batchDelete" >
- update dic_template set
- DT_IsDel = -1,
- DT_Recordor = #{dtRecordor,jdbcType=VARCHAR},
- DT_Record_Time = now()
- where DT_ID in
- <foreach collection="list" item="item" open="(" close=")" separator=",">
- #{item,jdbcType=INTEGER}
- </foreach>
- </update>
- </mapper>
|