TCustomerContactMapper.xml 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.ruoyi.basicData.mapper.TCustomerContactMapper">
  6. <resultMap type="TCustomerContact" id="TCustomerContactResult">
  7. <result property="tId" column="t_id"/>
  8. <result property="fPid" column="f_pid"/>
  9. <result property="fNo" column="f_no"/>
  10. <result property="fName" column="f_name"/>
  11. <result property="fEname" column="f_ename"/>
  12. <result property="fTel" column="f_tel"/>
  13. <result property="fDuty" column="f_duty"/>
  14. <result property="fEmail" column="f_email"/>
  15. <result property="fWx" column="f_wx"/>
  16. <result property="fStatus" column="f_status"/>
  17. <result property="delFlag" column="del_flag"/>
  18. <result property="createBy" column="create_by"/>
  19. <result property="createTime" column="create_time"/>
  20. <result property="updateBy" column="update_by"/>
  21. <result property="updateTime" column="update_time"/>
  22. <result property="remark" column="remark"/>
  23. <result property="deptId" column="dept_id"/>
  24. <result property="userId" column="user_id"/>
  25. </resultMap>
  26. <sql id="selectTCustomerContactVo">
  27. select t_id, f_pid, f_no, f_name, f_ename, f_tel, f_duty, f_email, f_wx, dept_id, user_id, f_status, del_flag, create_by, create_time, update_by, update_time, remark from t_customer_contact
  28. </sql>
  29. <select id="selectTCustomerContactList" parameterType="TCustomerContact" resultMap="TCustomerContactResult">
  30. <include refid="selectTCustomerContactVo"/>
  31. <where>
  32. <if test="fPid != null ">and f_pid = #{fPid}</if>
  33. <if test="fNo != null and fNo != ''">and f_no = #{fNo}</if>
  34. <if test="fName != null and fName != ''">and f_name like concat('%', #{fName}, '%')</if>
  35. <if test="fEname != null and fEname != ''">and f_ename like concat('%', #{fEname}, '%')</if>
  36. <if test="fTel != null and fTel != ''">and f_tel = #{fTel}</if>
  37. <if test="fDuty != null and fDuty != ''">and f_duty = #{fDuty}</if>
  38. <if test="fEmail != null and fEmail != ''">and f_email = #{fEmail}</if>
  39. <if test="userId != null and userId != ''">and user_id = #{userId}</if>
  40. <if test="fWx != null and fWx != ''">and f_wx = #{fWx}</if>
  41. <if test="fStatus != null and fStatus != ''">and f_status = #{fStatus}</if>
  42. </where>
  43. </select>
  44. <select id="selectTCustomerContactById" parameterType="Long" resultMap="TCustomerContactResult">
  45. <include refid="selectTCustomerContactVo"/>
  46. where t_id = #{tId}
  47. </select>
  48. <select id="checkTelUnique" parameterType="string" resultType="int">
  49. select count(t_id) from t_customer_contact where f_tel = #{fTel}
  50. </select>
  51. <insert id="insertTCustomerContact" parameterType="TCustomerContact" useGeneratedKeys="true" keyProperty="tId">
  52. insert into t_customer_contact
  53. <trim prefix="(" suffix=")" suffixOverrides=",">
  54. <if test="fPid != null">f_pid,</if>
  55. <if test="fNo != null and fNo != ''">f_no,</if>
  56. <if test="fName != null and fName != ''">f_name,</if>
  57. <if test="fEname != null">f_ename,</if>
  58. <if test="fTel != null">f_tel,</if>
  59. <if test="fDuty != null">f_duty,</if>
  60. <if test="fEmail != null">f_email,</if>
  61. <if test="fWx != null">f_wx,</if>
  62. <if test="fStatus != null">f_status,</if>
  63. <if test="delFlag != null">del_flag,</if>
  64. <if test="createBy != null">create_by,</if>
  65. <if test="createTime != null">create_time,</if>
  66. <if test="updateBy != null">update_by,</if>
  67. <if test="updateTime != null">update_time,</if>
  68. <if test="remark != null">remark,</if>
  69. <if test="deptId != null">dept_id,</if>
  70. <if test="userId != null">user_id,</if>
  71. </trim>
  72. <trim prefix="values (" suffix=")" suffixOverrides=",">
  73. <if test="fPid != null">#{fPid},</if>
  74. <if test="fNo != null and fNo != ''">#{fNo},</if>
  75. <if test="fName != null and fName != ''">#{fName},</if>
  76. <if test="fEname != null">#{fEname},</if>
  77. <if test="fTel != null">#{fTel},</if>
  78. <if test="fDuty != null">#{fDuty},</if>
  79. <if test="fEmail != null">#{fEmail},</if>
  80. <if test="fWx != null">#{fWx},</if>
  81. <if test="fStatus != null">#{fStatus},</if>
  82. <if test="delFlag != null">#{delFlag},</if>
  83. <if test="createBy != null">#{createBy},</if>
  84. <if test="createTime != null">#{createTime},</if>
  85. <if test="updateBy != null">#{updateBy},</if>
  86. <if test="updateTime != null">#{updateTime},</if>
  87. <if test="remark != null">#{remark},</if>
  88. <if test="deptId != null">#{deptId},</if>
  89. <if test="userId != null">#{userId},</if>
  90. </trim>
  91. </insert>
  92. <update id="updateTCustomerContact" parameterType="TCustomerContact">
  93. update t_customer_contact
  94. <trim prefix="SET" suffixOverrides=",">
  95. <if test="fPid != null">f_pid = #{fPid},</if>
  96. <if test="fNo != null and fNo != ''">f_no = #{fNo},</if>
  97. <if test="fName != null and fName != ''">f_name = #{fName},</if>
  98. <if test="fEname != null">f_ename = #{fEname},</if>
  99. <if test="fTel != null">f_tel = #{fTel},</if>
  100. <if test="fDuty != null">f_duty = #{fDuty},</if>
  101. <if test="fEmail != null">f_email = #{fEmail},</if>
  102. <if test="fWx != null">f_wx = #{fWx},</if>
  103. <if test="fStatus != null">f_status = #{fStatus},</if>
  104. <if test="delFlag != null">del_flag = #{delFlag},</if>
  105. <if test="createBy != null">create_by = #{createBy},</if>
  106. <if test="createTime != null">create_time = #{createTime},</if>
  107. <if test="updateBy != null">update_by = #{updateBy},</if>
  108. <if test="updateTime != null">update_time = #{updateTime},</if>
  109. <if test="remark != null">remark = #{remark},</if>
  110. <if test="deptId != null">dept_id = #{deptId},</if>
  111. <if test="userId != null">user_id = #{userId},</if>
  112. </trim>
  113. where t_id = #{tId}
  114. </update>
  115. <delete id="deleteTCustomerContactById" parameterType="Long">
  116. delete from t_customer_contact where t_id = #{tId}
  117. </delete>
  118. <delete id="deleteTCustomerContactByIds" parameterType="String">
  119. delete from t_customer_contact where t_id in
  120. <foreach item="tId" collection="array" open="(" separator="," close=")">
  121. #{tId}
  122. </foreach>
  123. </delete>
  124. <delete id="deleteCustomerContactByCorps" parameterType="Long">
  125. delete from t_customer_contact where f_pid = #{fPid}
  126. </delete>
  127. </mapper>