CompanyVoiceCallerMapper.xml 4.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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.fs.company.mapper.CompanyVoiceCallerMapper">
  6. <resultMap type="CompanyVoiceCaller" id="CompanyVoiceCallerResult">
  7. <result property="callerId" column="caller_id" />
  8. <result property="companyId" column="company_id" />
  9. <result property="companyUserId" column="company_user_id" />
  10. <result property="callerNo" column="caller_no" />
  11. <result property="mobile" column="mobile" />
  12. <result property="status" column="status" />
  13. <result property="remark" column="remark" />
  14. <result property="bindTime" column="bind_time" />
  15. </resultMap>
  16. <sql id="selectCompanyVoiceCallerVo">
  17. select caller_id, company_id, company_user_id, caller_no, mobile, status, remark,bind_time from company_voice_caller
  18. </sql>
  19. <select id="selectCompanyVoiceCallerList" parameterType="CompanyVoiceCaller" resultMap="CompanyVoiceCallerResult">
  20. <include refid="selectCompanyVoiceCallerVo"/>
  21. <where>
  22. <if test="companyId != null "> and company_id = #{companyId}</if>
  23. <if test="companyUserId != null "> and company_user_id = #{companyUserId}</if>
  24. <if test="callerNo != null and callerNo != ''"> and caller_no = #{callerNo}</if>
  25. <if test="mobile != null and mobile != ''"> and mobile = #{mobile}</if>
  26. <if test="status != null "> and status = #{status}</if>
  27. </where>
  28. </select>
  29. <select id="selectCompanyVoiceCallerById" parameterType="Long" resultMap="CompanyVoiceCallerResult">
  30. <include refid="selectCompanyVoiceCallerVo"/>
  31. where caller_id = #{callerId}
  32. </select>
  33. <insert id="insertCompanyVoiceCaller" parameterType="CompanyVoiceCaller" useGeneratedKeys="true" keyProperty="callerId">
  34. insert into company_voice_caller
  35. <trim prefix="(" suffix=")" suffixOverrides=",">
  36. <if test="companyId != null">company_id,</if>
  37. <if test="companyUserId != null">company_user_id,</if>
  38. <if test="callerNo != null">caller_no,</if>
  39. <if test="mobile != null">mobile,</if>
  40. <if test="status != null">status,</if>
  41. <if test="remark != null">remark,</if>
  42. <if test="bindTime != null">bind_time,</if>
  43. </trim>
  44. <trim prefix="values (" suffix=")" suffixOverrides=",">
  45. <if test="companyId != null">#{companyId},</if>
  46. <if test="companyUserId != null">#{companyUserId},</if>
  47. <if test="callerNo != null">#{callerNo},</if>
  48. <if test="mobile != null">#{mobile},</if>
  49. <if test="status != null">#{status},</if>
  50. <if test="remark != null">#{remark},</if>
  51. <if test="bindTime != null">#{bindTime},,</if>
  52. </trim>
  53. </insert>
  54. <update id="updateCompanyVoiceCaller" parameterType="CompanyVoiceCaller">
  55. update company_voice_caller
  56. <trim prefix="SET" suffixOverrides=",">
  57. <if test="companyId != null">company_id = #{companyId},</if>
  58. <if test="companyUserId != null">company_user_id = #{companyUserId},</if>
  59. <if test="callerNo != null">caller_no = #{callerNo},</if>
  60. <if test="mobile != null">mobile = #{mobile},</if>
  61. <if test="status != null">status = #{status},</if>
  62. <if test="remark != null">remark = #{remark},</if>
  63. bind_time = #{bindTime}
  64. </trim>
  65. where caller_id = #{callerId}
  66. </update>
  67. <delete id="deleteCompanyVoiceCallerById" parameterType="Long">
  68. delete from company_voice_caller where caller_id = #{callerId}
  69. </delete>
  70. <delete id="deleteCompanyVoiceCallerByIds" parameterType="String">
  71. delete from company_voice_caller where caller_id in
  72. <foreach item="callerId" collection="array" open="(" separator="," close=")">
  73. #{callerId}
  74. </foreach>
  75. </delete>
  76. </mapper>