DicConsulationTeamMapper.xml 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  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.sysservice.dao.mysqlmapper.DicConsulationTeamMapper" >
  4. <resultMap id="BaseResultMap" type="com.xinxin.topro.sysservice.dao.mysqlmodel.DicConsulationTeam" >
  5. <id column="DCT_ID" property="dctId" jdbcType="INTEGER" />
  6. <result column="HI_ID" property="hiId" jdbcType="INTEGER" />
  7. <result column="DCT_Name" property="dctName" jdbcType="VARCHAR" />
  8. <result column="DCT_Recordor" property="dctRecordor" jdbcType="VARCHAR" />
  9. <result column="DCT_Record_Time" property="dctRecordTime" jdbcType="TIMESTAMP" />
  10. <result column="DCT_IsDel" property="dctIsdel" jdbcType="INTEGER" />
  11. <result column="DCT_Type" property="dctType" jdbcType="INTEGER" />
  12. <result column="DCT_PinyinCode" property="dctPinYinCode" jdbcType="VARCHAR"/>
  13. <result column="DCT_WubiCode" property="dctWubiCode" jdbcType="VARCHAR"/>
  14. <result column="DCT_OtherCode" property="dctOtherCode" jdbcType="VARCHAR"/>
  15. <result column="DCT_Ward" property="dctWard" jdbcType="VARCHAR"/>
  16. <result column="DCT_Dept" property="dctDept" jdbcType="VARCHAR" />
  17. </resultMap>
  18. <resultMap id="ListRequestMap" extends="BaseResultMap" type="com.xinxin.topro.sysservice.dao.mysqlmodel.DicConsulationTeamVO">
  19. <result column="UI_Name" property="userName" jdbcType="VARCHAR"/>
  20. <result column="DD_DepName" property="depName" jdbcType="VARCHAR"/>
  21. <result column="DW_WardName" property="wardName" jdbcType="VARCHAR" />
  22. </resultMap>
  23. <sql id="Base_Column_List" >
  24. DCT_ID, HI_ID, DCT_Name, DCT_Recordor, DCT_Record_Time, DCT_IsDel, DCT_Type,DCT_PinyinCode,DCT_WubiCode,DCT_OtherCode,DCT_Ward,DCT_Dept
  25. </sql>
  26. <select id="selectByPrimaryKey" resultMap="ListRequestMap" parameterType="java.lang.Integer" >
  27. select DCT_ID, dct.HI_ID, DCT_Name, DCT_Recordor, DCT_Record_Time, DCT_IsDel, DCT_Type,DCT_PinyinCode,DCT_WubiCode,DCT_OtherCode,DCT_Ward,DCT_Dept,
  28. sysuser.UI_Name userName,
  29. depart.DD_DepName depName,
  30. ward.DW_WardName wardName
  31. from dic_consultation_team dct
  32. left join sys_userinfo sysuser on dct.DCT_Recordor = sysuser.UI_Code
  33. left join dic_department depart on dct.DCT_Dept = depart.DD_DepDm
  34. left join dic_ward ward on dct.DCT_Ward = ward.DW_WardDm
  35. where DCT_ID = #{dctId,jdbcType=INTEGER}
  36. </select>
  37. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
  38. delete from dic_consultation_team
  39. where DCT_ID = #{dctId,jdbcType=INTEGER}
  40. </delete>
  41. <insert id="insert" parameterType="com.xinxin.topro.sysservice.dao.mysqlmodel.DicConsulationTeam" >
  42. insert into dic_consultation_team (DCT_ID, HI_ID, DCT_Name,
  43. DCT_Recordor, DCT_Record_Time,DCT_IsDel, DCT_Type,DCT_PinyinCode,DCT_WubiCode,DCT_OtherCode,DCT_Ward,DCT_Dept)
  44. values (#{dctId,jdbcType=INTEGER}, #{hiId,jdbcType=INTEGER}, #{dctName,jdbcType=VARCHAR},
  45. #{dctRecordor,jdbcType=VARCHAR}, #{dctRecordTime,jdbcType=TIMESTAMP},
  46. #{dctIsdel,jdbcType=INTEGER}, #{dctType,jdbcType=INTEGER},#{dctPinYinCode,jdbcType=VARCHAR},
  47. #{dctWubiCode,jdbcType=VARCHAR},#{dctOtherCode,jdbcType=VARCHAR},#{dctWard,jdbcType=VARCHAR},
  48. #{dctDept,jdbcType=VARCHAR})
  49. </insert>
  50. <insert id="insertSelective" parameterType="com.xinxin.topro.sysservice.dao.mysqlmodel.DicConsulationTeam" >
  51. insert into dic_consultation_team
  52. <trim prefix="(" suffix=")" suffixOverrides="," >
  53. <if test="dctId != null" >
  54. DCT_ID,
  55. </if>
  56. <if test="hiId != null" >
  57. HI_ID,
  58. </if>
  59. <if test="dctName != null" >
  60. DCT_Name,
  61. </if>
  62. <if test="dctRecordor != null" >
  63. DCT_Recordor,
  64. </if>
  65. <if test="dctRecordTime != null" >
  66. DCT_Record_Time,
  67. </if>
  68. <if test="dctIsdel != null" >
  69. DCT_IsDel,
  70. </if>
  71. <if test="dctType != null" >
  72. DCT_Type,
  73. </if>
  74. <if test="dctPinYinCode != null" >
  75. DCT_PinyinCode,
  76. </if>
  77. <if test="dctWubiCode != null" >
  78. DCT_WubiCode,
  79. </if>
  80. <if test="dctOtherCode != null" >
  81. DCT_OtherCode,
  82. </if>
  83. <if test="dctWard != null" >
  84. DCT_Ward,
  85. </if>
  86. <if test="dctDept != null" >
  87. DCT_Dept,
  88. </if>
  89. </trim>
  90. <trim prefix="values (" suffix=")" suffixOverrides="," >
  91. <if test="dctId != null" >
  92. #{dctId,jdbcType=INTEGER},
  93. </if>
  94. <if test="hiId != null" >
  95. #{hiId,jdbcType=INTEGER},
  96. </if>
  97. <if test="dctName != null" >
  98. #{dctName,jdbcType=VARCHAR},
  99. </if>
  100. <if test="dctRecordor != null" >
  101. #{dctRecordor,jdbcType=VARCHAR},
  102. </if>
  103. <if test="dctRecordTime != null" >
  104. #{dctRecordTime,jdbcType=TIMESTAMP},
  105. </if>
  106. <if test="dctIsdel != null" >
  107. #{dctIsdel,jdbcType=INTEGER},
  108. </if>
  109. <if test="dctType != null" >
  110. #{dctType,jdbcType=INTEGER},
  111. </if>
  112. <if test="dctPinYinCode != null" >
  113. #{dctPinYinCode,jdbcType=INTEGER},
  114. </if>
  115. <if test="dctWubiCode != null" >
  116. #{dctWubiCode,jdbcType=INTEGER},
  117. </if>
  118. <if test="dctOtherCode != null" >
  119. #{dctOtherCode,jdbcType=INTEGER},
  120. </if>
  121. <if test="dctWard != null" >
  122. #{dctWard,jdbcType=INTEGER},
  123. </if>
  124. <if test="dctDept != null" >
  125. #{dctDept,jdbcType=INTEGER},
  126. </if>
  127. </trim>
  128. </insert>
  129. <update id="updateByPrimaryKeySelective" parameterType="com.xinxin.topro.sysservice.dao.mysqlmodel.DicConsulationTeam" >
  130. update dic_consultation_team
  131. <set >
  132. <if test="hiId != null" >
  133. HI_ID = #{hiId,jdbcType=INTEGER},
  134. </if>
  135. <if test="dctName != null" >
  136. DCT_Name = #{dctName,jdbcType=VARCHAR},
  137. </if>
  138. <if test="dctRecordor != null" >
  139. DCT_Recordor = #{dctRecordor,jdbcType=VARCHAR},
  140. </if>
  141. <if test="dctRecordTime != null" >
  142. DCT_Record_Time = #{dctRecordTime,jdbcType=TIMESTAMP},
  143. </if>
  144. <if test="dctIsdel != null" >
  145. DCT_IsDel = #{dctIsdel,jdbcType=INTEGER},
  146. </if>
  147. <if test="dctType != null" >
  148. DCT_Type = #{dctType,jdbcType=INTEGER},
  149. </if>
  150. <if test="dctPinYinCode != null" >
  151. DCT_PinYinCode = #{dctPinYinCode,jdbcType=VARCHAR},
  152. </if>
  153. <if test="dctWubiCode != null" >
  154. DCT_WubiCode = #{dctWubiCode,jdbcType=VARCHAR},
  155. </if>
  156. <if test="dctOtherCode != null" >
  157. DCT_OtherCode = #{dctOtherCode,jdbcType=VARCHAR},
  158. </if>
  159. <if test="dctWard != null" >
  160. DCT_Ward = #{dctWard,jdbcType=VARCHAR},
  161. </if>
  162. <if test="dctDept != null" >
  163. DCT_Dept = #{dctDept,jdbcType=VARCHAR},
  164. </if>
  165. </set>
  166. where DCT_ID = #{dctId,jdbcType=INTEGER}
  167. </update>
  168. <update id="updateByPrimaryKey" parameterType="com.xinxin.topro.sysservice.dao.mysqlmodel.DicConsulationTeam" >
  169. update dic_consultation_team
  170. set HI_ID = #{hiId,jdbcType=INTEGER},
  171. DCT_Name = #{dctName,jdbcType=VARCHAR},
  172. DCT_Recordor = #{dctRecordor,jdbcType=VARCHAR},
  173. DCT_Record_Time = #{dctRecordTime,jdbcType=TIMESTAMP},
  174. DCT_IsDel = #{dctIsdel,jdbcType=INTEGER},
  175. DCT_Type = #{dctType,jdbcType=INTEGER},
  176. DCT_PinYinCode = #{dctPinYinCode,jdbcType=INTEGER},
  177. DCT_WubiCode = #{dctWubiCode,jdbcType=INTEGER},
  178. DCT_OtherCode = #{dctOtherCode,jdbcType=INTEGER},
  179. DCT_Ward = #{dctWard,jdbcType=INTEGER},
  180. DCT_Dept = #{dctDept,jdbcType=INTEGER}
  181. where DCT_ID = #{dctId,jdbcType=INTEGER}
  182. </update>
  183. <update id="delConsulationTeam" parameterType="java.lang.Integer" >
  184. update dic_consultation_team
  185. set DCT_IsDel = -1
  186. where DCT_ID = #{dctId,jdbcType=INTEGER}
  187. </update>
  188. <select id="getDicConsulationList" resultMap="ListRequestMap">
  189. select DCT_ID, dct.HI_ID, DCT_Name, DCT_Recordor, DCT_Record_Time, DCT_IsDel, DCT_Type,DCT_PinyinCode,DCT_WubiCode,DCT_OtherCode,DCT_Ward,DCT_Dept,
  190. sysuser.UI_Name userName,
  191. depart.DD_DepName depName,
  192. ward.DW_WardName wardName
  193. from dic_consultation_team dct
  194. left join sys_userinfo sysuser on dct.DCT_Recordor = sysuser.UI_Code
  195. left join dic_department depart on dct.DCT_Dept = depart.DD_DepDm
  196. left join dic_ward ward on dct.DCT_Ward = ward.DW_WardDm
  197. where DCT_IsDel = 0
  198. </select>
  199. <select id="getDicConsulationListWithDel" resultMap="ListRequestMap">
  200. select DCT_ID, dct.HI_ID, DCT_Name, DCT_Recordor, DCT_Record_Time, DCT_IsDel, DCT_Type,DCT_PinyinCode,DCT_WubiCode,DCT_OtherCode,DCT_Ward,DCT_Dept,
  201. sysuser.UI_Name userName,
  202. depart.DD_DepName depName,
  203. ward.DW_WardName wardName
  204. from dic_consultation_team dct
  205. left join sys_userinfo sysuser on dct.DCT_Recordor = sysuser.UI_Code
  206. left join dic_department depart on dct.DCT_Dept = depart.DD_DepDm
  207. left join dic_ward ward on dct.DCT_Ward = ward.DW_WardDm
  208. </select>
  209. <select id="getListByKeyWord" parameterType="java.lang.String" resultMap="ListRequestMap">
  210. select DCT_ID, dct.HI_ID, DCT_Name, DCT_Recordor, DCT_Record_Time, DCT_IsDel, DCT_Type,DCT_PinyinCode,DCT_WubiCode,DCT_OtherCode,DCT_Ward,DCT_Dept,
  211. sysuser.UI_Name userName,
  212. depart.DD_DepName depName,
  213. ward.DW_WardName wardName
  214. from dic_consultation_team dct
  215. left join sys_userinfo sysuser on dct.DCT_Recordor = sysuser.UI_Code
  216. left join dic_department depart on dct.DCT_Dept = depart.DD_DepDm
  217. left join dic_ward ward on dct.DCT_Ward = ward.DW_WardDm
  218. where DCT_Name like concat('%',#{keyWord,jdbcType=VARCHAR},'%')
  219. </select>
  220. </mapper>