BCustomerQuestionErrorMapper.xml 4.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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.back.mapper.BCustomerQuestionErrorMapper">
  6. <resultMap type="BCustomerQuestionError" id="BCustomerQuestionErrorResult">
  7. <result property="id" column="id" />
  8. <result property="customercode" column="customerCode" />
  9. <result property="questionid" column="questionId" />
  10. <result property="remark" column="remark" />
  11. <result property="createTime" column="createTime" />
  12. <result property="status" column="status" />
  13. <association property="user" column="customerCode" javaType="SysUser" resultMap="SysUserResult" />
  14. </resultMap>
  15. <resultMap type="SysUser" id="SysUserResult">
  16. <id property="userId" column="user_id" />
  17. <result property="userName" column="user_name" />
  18. <result property="nickName" column="nick_name" />
  19. <result property="phonenumber" column="phonenumber" />
  20. </resultMap>
  21. <sql id="selectBCustomerQuestionErrorVo">
  22. select bcqe.id, bcqe.customerCode, bcqe.questionId, bcqe.remark, bcqe.createTime, bcqe.status
  23. ,u.user_id,u.user_name,u.nick_name,u.phonenumber
  24. from b_customer_question_error bcqe
  25. LEFT JOIN sys_user u on bcqe.customerCode=u.user_id
  26. </sql>
  27. <select id="selectBCustomerQuestionErrorList" parameterType="BCustomerQuestionError" resultMap="BCustomerQuestionErrorResult">
  28. <include refid="selectBCustomerQuestionErrorVo"/>
  29. where 1=1
  30. <if test="customercode != null and customercode != ''"> and bcqe.customerCode = #{customercode}</if>
  31. <if test="questionid != null and questionid != ''"> and bcqe.questionId = #{questionid}</if>
  32. <if test="createTime != null "> and bcqe.createTime = #{createTime}</if>
  33. <if test="status != null "> and bcqe.status = #{status}</if>
  34. order by id desc
  35. </select>
  36. <select id="selectBCustomerQuestionErrorById" parameterType="Long" resultMap="BCustomerQuestionErrorResult">
  37. <include refid="selectBCustomerQuestionErrorVo"/>
  38. where id = #{id}
  39. </select>
  40. <insert id="insertBCustomerQuestionError" parameterType="BCustomerQuestionError" useGeneratedKeys="true" keyProperty="id">
  41. insert into b_customer_question_error
  42. <trim prefix="(" suffix=")" suffixOverrides=",">
  43. <if test="customercode != null">customerCode,</if>
  44. <if test="questionid != null">questionId,</if>
  45. <if test="remark != null and remark != ''">remark,</if>
  46. <if test="createTime != null">createTime,</if>
  47. <if test="status != null">status,</if>
  48. </trim>
  49. <trim prefix="values (" suffix=")" suffixOverrides=",">
  50. <if test="customercode != null">#{customercode},</if>
  51. <if test="questionid != null">#{questionid},</if>
  52. <if test="remark != null and remark != ''">#{remark},</if>
  53. <if test="createTime != null">#{createTime},</if>
  54. <if test="status != null">#{status},</if>
  55. </trim>
  56. </insert>
  57. <update id="updateBCustomerQuestionError" parameterType="BCustomerQuestionError">
  58. update b_customer_question_error
  59. <trim prefix="SET" suffixOverrides=",">
  60. <if test="customercode != null">customerCode = #{customercode},</if>
  61. <if test="questionid != null">questionId = #{questionid},</if>
  62. <if test="remark != null and remark != ''">remark = #{remark},</if>
  63. <if test="createTime != null">createTime = #{createTime},</if>
  64. <if test="status != null">status = #{status},</if>
  65. </trim>
  66. where id = #{id}
  67. </update>
  68. <delete id="deleteBCustomerQuestionErrorById" parameterType="Long">
  69. delete from b_customer_question_error where id = #{id}
  70. </delete>
  71. <delete id="deleteBCustomerQuestionErrorByIds" parameterType="String">
  72. delete from b_customer_question_error where id in
  73. <foreach item="id" collection="array" open="(" separator="," close=")">
  74. #{id}
  75. </foreach>
  76. </delete>
  77. </mapper>