DicConsulationUserMapper.xml 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  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.DicConsulationUserMapper" >
  4. <resultMap id="BaseResultMap" type="com.xinxin.topro.inpnurseservice.mysqlmodel.DicConsulationUser" >
  5. <id column="DCU_ID" property="dcuId" jdbcType="INTEGER" />
  6. <result column="DCT_ID" property="dctId" jdbcType="INTEGER" />
  7. <result column="DCU_User" property="dcuUser" jdbcType="VARCHAR" />
  8. <result column="DCU_Recordor" property="dcuRecordor" jdbcType="VARCHAR" />
  9. <result column="DCU_Record_Time" property="dcuRecordTime" jdbcType="TIMESTAMP" />
  10. <result column="DCU_IsDel" property="dcuIsdel" jdbcType="INTEGER" />
  11. </resultMap>
  12. <sql id="Base_Column_List" >
  13. DCU_ID, DCT_ID, DCU_User, DCU_Recordor, DCU_Record_Time, DCU_IsDel
  14. </sql>
  15. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
  16. select
  17. <include refid="Base_Column_List" />
  18. from dic_consulation_user
  19. where DCU_IsDel = 0 and DCU_ID = #{dcuId,jdbcType=INTEGER}
  20. </select>
  21. <select id="selectAll" resultType="com.xinxin.topro.inpnurseservice.vo.DicConsulationUserVO">
  22. SELECT
  23. dcu.DCU_ID as dcuId,
  24. dcu.DCT_ID as dctId,
  25. dcu.DCU_User as dcuUser,
  26. su.UI_Name as dcuUserName
  27. FROM dic_consulation_user dcu
  28. LEFT JOIN sys_userinfo su
  29. on dcu.DCU_User = su.UI_Code
  30. where dcu.DCU_IsDel = 0 and su.SS_ISDel = 0 and su.SU_Status = 0
  31. </select>
  32. <select id="selectByIds" resultType="com.xinxin.topro.inpnurseservice.vo.DicConsulationUserVO">
  33. SELECT
  34. dcu.DCU_ID as dcuId,
  35. dcu.DCT_ID as dctId,
  36. dcu.DCU_User as dcuUser,
  37. su.UI_Name as dcuUserName
  38. FROM dic_consulation_user dcu
  39. LEFT JOIN sys_userinfo su
  40. on dcu.DCU_User = su.UI_Code
  41. where dcu.DCU_IsDel = 0 and su.SS_ISDel = 0 and su.SU_Status = 0
  42. and dcu.DCT_ID in <foreach collection="list" item="item" separator="," index="index" open="(" close=")">
  43. #{item,jdbcType=INTEGER}
  44. </foreach>
  45. </select>
  46. <select id="selectUserCode" resultMap="BaseResultMap" parameterType="java.lang.String" >
  47. select
  48. <include refid="Base_Column_List" />
  49. from dic_consulation_user
  50. where DCU_IsDel = 0 and DCU_User = #{code,jdbcType=VARCHAR}
  51. </select>
  52. <select id="selectTeamByUserCode"
  53. resultType="com.xinxin.topro.inpnurseservice.mysqlmodel.DicConsultationTeam">
  54. select
  55. dct.DCT_ID as dctId,
  56. dct.DCT_Name as dctName
  57. from dic_consulation_user dcu
  58. left join dic_consultation_team dct
  59. on dcu.DCT_ID = dct.DCT_ID
  60. where dcu.DCU_User = #{uiCode}
  61. and dcu.DCU_IsDel = 0
  62. and dct.DCT_IsDel = 0
  63. and dct.DCT_Type = 1
  64. </select>
  65. <select id="selectUserByTeamCode" resultType="java.lang.String">
  66. select
  67. dcu.DCU_User
  68. from dic_consulation_user dcu
  69. inner join dic_consultation_team dct
  70. on dcu.DCT_ID = dct.DCT_ID
  71. where dct.DCT_PinyinCode = #{code}
  72. and dcu.DCU_IsDel = 0
  73. and dct.DCT_IsDel = 0
  74. and dct.DCT_Type = 1
  75. </select>
  76. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
  77. delete from dic_consulation_user
  78. where DCU_ID = #{dcuId,jdbcType=INTEGER}
  79. </delete>
  80. <insert id="insert" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.DicConsulationUser" >
  81. insert into dic_consulation_user (DCU_ID, DCT_ID, DCU_User,
  82. DCU_Recordor, DCU_Record_Time, DCU_IsDel
  83. )
  84. values (#{dcuId,jdbcType=INTEGER}, #{dctId,jdbcType=INTEGER}, #{dcuUser,jdbcType=VARCHAR},
  85. #{dcuRecordor,jdbcType=VARCHAR}, #{dcuRecordTime,jdbcType=TIMESTAMP}, #{dcuIsdel,jdbcType=INTEGER}
  86. )
  87. </insert>
  88. <insert id="insertSelective" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.DicConsulationUser" >
  89. insert into dic_consulation_user
  90. <trim prefix="(" suffix=")" suffixOverrides="," >
  91. <if test="dcuId != null" >
  92. DCU_ID,
  93. </if>
  94. <if test="dctId != null" >
  95. DCT_ID,
  96. </if>
  97. <if test="dcuUser != null" >
  98. DCU_User,
  99. </if>
  100. <if test="dcuRecordor != null" >
  101. DCU_Recordor,
  102. </if>
  103. <if test="dcuRecordTime != null" >
  104. DCU_Record_Time,
  105. </if>
  106. <if test="dcuIsdel != null" >
  107. DCU_IsDel,
  108. </if>
  109. </trim>
  110. <trim prefix="values (" suffix=")" suffixOverrides="," >
  111. <if test="dcuId != null" >
  112. #{dcuId,jdbcType=INTEGER},
  113. </if>
  114. <if test="dctId != null" >
  115. #{dctId,jdbcType=INTEGER},
  116. </if>
  117. <if test="dcuUser != null" >
  118. #{dcuUser,jdbcType=VARCHAR},
  119. </if>
  120. <if test="dcuRecordor != null" >
  121. #{dcuRecordor,jdbcType=VARCHAR},
  122. </if>
  123. <if test="dcuRecordTime != null" >
  124. #{dcuRecordTime,jdbcType=TIMESTAMP},
  125. </if>
  126. <if test="dcuIsdel != null" >
  127. #{dcuIsdel,jdbcType=INTEGER},
  128. </if>
  129. </trim>
  130. </insert>
  131. <update id="updateByPrimaryKeySelective" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.DicConsulationUser" >
  132. update dic_consulation_user
  133. <set >
  134. <if test="dctId != null" >
  135. DCT_ID = #{dctId,jdbcType=INTEGER},
  136. </if>
  137. <if test="dcuUser != null" >
  138. DCU_User = #{dcuUser,jdbcType=VARCHAR},
  139. </if>
  140. <if test="dcuRecordor != null" >
  141. DCU_Recordor = #{dcuRecordor,jdbcType=VARCHAR},
  142. </if>
  143. <if test="dcuRecordTime != null" >
  144. DCU_Record_Time = #{dcuRecordTime,jdbcType=TIMESTAMP},
  145. </if>
  146. <if test="dcuIsdel != null" >
  147. DCU_IsDel = #{dcuIsdel,jdbcType=INTEGER},
  148. </if>
  149. </set>
  150. where DCU_ID = #{dcuId,jdbcType=INTEGER}
  151. </update>
  152. <update id="updateByPrimaryKey" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.DicConsulationUser" >
  153. update dic_consulation_user
  154. set DCT_ID = #{dctId,jdbcType=INTEGER},
  155. DCU_User = #{dcuUser,jdbcType=VARCHAR},
  156. DCU_Recordor = #{dcuRecordor,jdbcType=VARCHAR},
  157. DCU_Record_Time = #{dcuRecordTime,jdbcType=TIMESTAMP},
  158. DCU_IsDel = #{dcuIsdel,jdbcType=INTEGER}
  159. where DCU_ID = #{dcuId,jdbcType=INTEGER}
  160. </update>
  161. </mapper>