ConsultationUserMapper.xml 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  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.pubservice.mysqlmapper.ConsultationUserMapper" >
  4. <resultMap id="BaseResultMap" type="com.xinxin.topro.pubservice.mysqlModel.ConsultationUser" >
  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="selectByUserName" resultType="java.lang.String">
  22. SELECT du.DCU_User FROM `dic_consultation_team` dt
  23. LEFT JOIN dic_consulation_user du on dt.DCT_ID = du.DCT_ID
  24. where dt.DCT_Name like concat('%',#{name},'%') and dt.DCT_IsDel = 0 and du.DCU_IsDel = 0
  25. and (dt.HI_ID = 0 or dt.HI_ID = #{hiId,jdbcType=INTEGER})
  26. </select>
  27. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
  28. delete from dic_consulation_user
  29. where DCU_ID = #{dcuId,jdbcType=INTEGER}
  30. </delete>
  31. <insert id="insert" parameterType="com.xinxin.topro.pubservice.mysqlModel.ConsultationUser" >
  32. insert into dic_consulation_user (DCU_ID, DCT_ID, DCU_User,
  33. DCU_Recordor, DCU_Record_Time, DCU_IsDel
  34. )
  35. values (#{dcuId,jdbcType=INTEGER}, #{dctId,jdbcType=INTEGER}, #{dcuUser,jdbcType=VARCHAR},
  36. #{dcuRecordor,jdbcType=VARCHAR}, #{dcuRecordTime,jdbcType=TIMESTAMP}, #{dcuIsdel,jdbcType=INTEGER}
  37. )
  38. </insert>
  39. <insert id="insertSelective" parameterType="com.xinxin.topro.pubservice.mysqlModel.ConsultationUser" >
  40. insert into dic_consulation_user
  41. <trim prefix="(" suffix=")" suffixOverrides="," >
  42. <if test="dcuId != null" >
  43. DCU_ID,
  44. </if>
  45. <if test="dctId != null" >
  46. DCT_ID,
  47. </if>
  48. <if test="dcuUser != null" >
  49. DCU_User,
  50. </if>
  51. <if test="dcuRecordor != null" >
  52. DCU_Recordor,
  53. </if>
  54. <if test="dcuRecordTime != null" >
  55. DCU_Record_Time,
  56. </if>
  57. <if test="dcuIsdel != null" >
  58. DCU_IsDel,
  59. </if>
  60. </trim>
  61. <trim prefix="values (" suffix=")" suffixOverrides="," >
  62. <if test="dcuId != null" >
  63. #{dcuId,jdbcType=INTEGER},
  64. </if>
  65. <if test="dctId != null" >
  66. #{dctId,jdbcType=INTEGER},
  67. </if>
  68. <if test="dcuUser != null" >
  69. #{dcuUser,jdbcType=VARCHAR},
  70. </if>
  71. <if test="dcuRecordor != null" >
  72. #{dcuRecordor,jdbcType=VARCHAR},
  73. </if>
  74. <if test="dcuRecordTime != null" >
  75. #{dcuRecordTime,jdbcType=TIMESTAMP},
  76. </if>
  77. <if test="dcuIsdel != null" >
  78. #{dcuIsdel,jdbcType=INTEGER},
  79. </if>
  80. </trim>
  81. </insert>
  82. <update id="updateByPrimaryKeySelective" parameterType="com.xinxin.topro.pubservice.mysqlModel.ConsultationUser" >
  83. update dic_consulation_user
  84. <set >
  85. <if test="dctId != null" >
  86. DCT_ID = #{dctId,jdbcType=INTEGER},
  87. </if>
  88. <if test="dcuUser != null" >
  89. DCU_User = #{dcuUser,jdbcType=VARCHAR},
  90. </if>
  91. <if test="dcuRecordor != null" >
  92. DCU_Recordor = #{dcuRecordor,jdbcType=VARCHAR},
  93. </if>
  94. <if test="dcuRecordTime != null" >
  95. DCU_Record_Time = #{dcuRecordTime,jdbcType=TIMESTAMP},
  96. </if>
  97. <if test="dcuIsdel != null" >
  98. DCU_IsDel = #{dcuIsdel,jdbcType=INTEGER},
  99. </if>
  100. </set>
  101. where DCU_ID = #{dcuId,jdbcType=INTEGER}
  102. </update>
  103. <update id="updateByPrimaryKey" parameterType="com.xinxin.topro.pubservice.mysqlModel.ConsultationUser" >
  104. update dic_consulation_user
  105. set DCT_ID = #{dctId,jdbcType=INTEGER},
  106. DCU_User = #{dcuUser,jdbcType=VARCHAR},
  107. DCU_Recordor = #{dcuRecordor,jdbcType=VARCHAR},
  108. DCU_Record_Time = #{dcuRecordTime,jdbcType=TIMESTAMP},
  109. DCU_IsDel = #{dcuIsdel,jdbcType=INTEGER}
  110. where DCU_ID = #{dcuId,jdbcType=INTEGER}
  111. </update>
  112. </mapper>