DicTemplateMapper.xml 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
  3. <mapper namespace="com.xinxin.topro.inpnurseservice.mysqlmapper.DicTemplateMapper" >
  4. <resultMap id="BaseResultMap" type="com.xinxin.topro.inpnurseservice.mysqlmodel.DicTemplate" >
  5. <id column="DT_ID" property="dtId" jdbcType="INTEGER" />
  6. <result column="HI_ID" property="hiId" jdbcType="INTEGER" />
  7. <result column="DT_Name" property="dtName" jdbcType="VARCHAR" />
  8. <result column="DT_Model" property="dtModel" jdbcType="INTEGER" />
  9. <result column="DT_PinyinCode" property="dtPinyincode" jdbcType="VARCHAR" />
  10. <result column="DT_WubiCode" property="dtWubicode" jdbcType="VARCHAR" />
  11. <result column="DT_OtherCode" property="dtOthercode" jdbcType="VARCHAR" />
  12. <result column="DT_Sort" property="dtSort" jdbcType="INTEGER" />
  13. <result column="DD_DepDm" property="ddDepdm" jdbcType="VARCHAR" />
  14. <result column="DW_WardDm" property="dwWarddm" jdbcType="VARCHAR" />
  15. <result column="DT_Recordor" property="dtRecordor" jdbcType="VARCHAR" />
  16. <result column="DT_Record_Time" property="dtRecordTime" jdbcType="TIMESTAMP" />
  17. <result column="DT_SupID" property="dtSupid" jdbcType="INTEGER" />
  18. <result column="DT_IsDel" property="dtIsdel" jdbcType="INTEGER" />
  19. <result column="DT_Content" property="dtContent" jdbcType="LONGVARCHAR" />
  20. </resultMap>
  21. <sql id="Base_Column_List" >
  22. DT_ID, HI_ID, DT_Name, DT_Model, DT_PinyinCode, DT_WubiCode, DT_OtherCode, DT_Sort,
  23. DD_DepDm, DW_WardDm, DT_Recordor, DT_Record_Time, DT_SupID, DT_IsDel, DT_Content
  24. </sql>
  25. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
  26. select
  27. <include refid="Base_Column_List" />
  28. from dic_template
  29. where DT_ID = #{dtId,jdbcType=INTEGER}
  30. and DT_IsDel = 0
  31. </select>
  32. <update id="deleteByDtId" >
  33. update dic_template set
  34. DT_IsDel = -1,
  35. DT_Recordor = #{dtRecordor,jdbcType=VARCHAR},
  36. DT_Record_Time = now()
  37. where DT_ID = #{dtId,jdbcType=INTEGER}
  38. </update>
  39. <insert id="insert" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.DicTemplate" useGeneratedKeys="true" keyProperty="dtId">
  40. insert into dic_template (HI_ID, DT_Name,
  41. DT_Model, DT_PinyinCode, DT_WubiCode,
  42. DT_OtherCode, DT_Sort, DD_DepDm,
  43. DW_WardDm, DT_Recordor, DT_Record_Time,
  44. DT_SupID, DT_IsDel, DT_Content
  45. )
  46. values (#{hiId,jdbcType=INTEGER}, #{dtName,jdbcType=VARCHAR},
  47. #{dtModel,jdbcType=INTEGER}, #{dtPinyincode,jdbcType=VARCHAR}, #{dtWubicode,jdbcType=VARCHAR},
  48. #{dtOthercode,jdbcType=VARCHAR}, #{dtSort,jdbcType=INTEGER}, #{ddDepdm,jdbcType=VARCHAR},
  49. #{dwWarddm,jdbcType=VARCHAR}, #{dtRecordor,jdbcType=VARCHAR}, now(),
  50. #{dtSupid,jdbcType=INTEGER}, 0, #{dtContent,jdbcType=LONGVARCHAR}
  51. )
  52. </insert>
  53. <update id="updateByPrimaryKeySelective" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.DicTemplate" >
  54. update dic_template
  55. <set >
  56. <if test="hiId != null" >
  57. HI_ID = #{hiId,jdbcType=INTEGER},
  58. </if>
  59. <if test="dtName != null" >
  60. DT_Name = #{dtName,jdbcType=VARCHAR},
  61. </if>
  62. <if test="dtModel != null" >
  63. DT_Model = #{dtModel,jdbcType=INTEGER},
  64. </if>
  65. <if test="dtPinyincode != null" >
  66. DT_PinyinCode = #{dtPinyincode,jdbcType=VARCHAR},
  67. </if>
  68. <if test="dtWubicode != null" >
  69. DT_WubiCode = #{dtWubicode,jdbcType=VARCHAR},
  70. </if>
  71. <if test="dtOthercode != null" >
  72. DT_OtherCode = #{dtOthercode,jdbcType=VARCHAR},
  73. </if>
  74. <if test="dtSort != null" >
  75. DT_Sort = #{dtSort,jdbcType=INTEGER},
  76. </if>
  77. <if test="ddDepdm != null" >
  78. DD_DepDm = #{ddDepdm,jdbcType=VARCHAR},
  79. </if>
  80. <if test="dwWarddm != null" >
  81. DW_WardDm = #{dwWarddm,jdbcType=VARCHAR},
  82. </if>
  83. <if test="dtRecordor != null" >
  84. DT_Recordor = #{dtRecordor,jdbcType=VARCHAR},
  85. </if>
  86. <if test="dtIsdel != null" >
  87. DT_IsDel = #{dtIsdel,jdbcType=INTEGER},
  88. </if>
  89. <if test="dtContent != null" >
  90. DT_Content = #{dtContent,jdbcType=LONGVARCHAR},
  91. </if>
  92. DT_Record_Time = now(),
  93. DT_SupID = #{dtSupid,jdbcType=INTEGER}
  94. </set>
  95. where DT_ID = #{dtId,jdbcType=INTEGER}
  96. </update>
  97. <select id="selectByHiIdModel" resultMap="BaseResultMap">
  98. select <include refid="Base_Column_List" />
  99. from dic_template
  100. where DT_IsDel = 0
  101. and DT_Model = #{dtModel,jdbcType=INTEGER}
  102. and HI_ID = #{hiId,jdbcType=INTEGER}
  103. <if test="dwWarddm != null" >
  104. and DW_WardDm = #{dwWarddm,jdbcType=VARCHAR}
  105. </if>
  106. <if test="dtRecordor != null" >
  107. and DT_Recordor = #{dtRecordor,jdbcType=VARCHAR}
  108. </if>
  109. order by DT_Sort
  110. </select>
  111. <select id="countChildById" resultType="java.lang.Integer">
  112. select count(1)
  113. from dic_template
  114. where DT_IsDel = 0
  115. and DT_SupID = #{dtId,jdbcType=INTEGER}
  116. </select>
  117. <update id="batchDelete" >
  118. update dic_template set
  119. DT_IsDel = -1,
  120. DT_Recordor = #{dtRecordor,jdbcType=VARCHAR},
  121. DT_Record_Time = now()
  122. where DT_ID in
  123. <foreach collection="list" item="item" open="(" close=")" separator=",">
  124. #{item,jdbcType=INTEGER}
  125. </foreach>
  126. </update>
  127. </mapper>