CompanyVoiceDialogMapper.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.CompanyVoiceDialogMapper">
  6. <resultMap type="CompanyVoiceDialog" id="CompanyVoiceDialogResult">
  7. <result property="id" column="id" />
  8. <result property="name" column="name" />
  9. <result property="resultName" column="result_name" />
  10. <result property="resultId" column="result_id" />
  11. <result property="callNum" column="call_num" />
  12. <result property="remark" column="remark" />
  13. <result property="createTime" column="create_time" />
  14. <result property="createUser" column="create_user" />
  15. </resultMap>
  16. <sql id="selectCompanyVoiceDialogVo">
  17. select id, name, result_name, result_id, call_num, remark, create_time, create_user from company_voice_dialog
  18. </sql>
  19. <select id="selectCompanyVoiceDialogList" parameterType="CompanyVoiceDialog" resultMap="CompanyVoiceDialogResult">
  20. <include refid="selectCompanyVoiceDialogVo"/>
  21. <where>
  22. <if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
  23. <if test="resultName != null and resultName != ''"> and result_name like concat('%', #{resultName}, '%')</if>
  24. <if test="resultId != null "> and result_id = #{resultId}</if>
  25. <if test="callNum != null and callNum != ''"> and call_num = #{callNum}</if>
  26. <if test="createUser != null "> and create_user = #{createUser}</if>
  27. </where>
  28. </select>
  29. <select id="selectCompanyVoiceDialogById" parameterType="Long" resultMap="CompanyVoiceDialogResult">
  30. <include refid="selectCompanyVoiceDialogVo"/>
  31. where id = #{id}
  32. </select>
  33. <insert id="insertCompanyVoiceDialog" parameterType="CompanyVoiceDialog" useGeneratedKeys="true" keyProperty="id">
  34. insert into company_voice_dialog
  35. <trim prefix="(" suffix=")" suffixOverrides=",">
  36. <if test="name != null">name,</if>
  37. <if test="resultName != null">result_name,</if>
  38. <if test="resultId != null">result_id,</if>
  39. <if test="callNum != null">call_num,</if>
  40. <if test="remark != null">remark,</if>
  41. <if test="createTime != null">create_time,</if>
  42. <if test="createUser != null">create_user,</if>
  43. </trim>
  44. <trim prefix="values (" suffix=")" suffixOverrides=",">
  45. <if test="name != null">#{name},</if>
  46. <if test="resultName != null">#{resultName},</if>
  47. <if test="resultId != null">#{resultId},</if>
  48. <if test="callNum != null">#{callNum},</if>
  49. <if test="remark != null">#{remark},</if>
  50. <if test="createTime != null">#{createTime},</if>
  51. <if test="createUser != null">#{createUser},</if>
  52. </trim>
  53. </insert>
  54. <update id="updateCompanyVoiceDialog" parameterType="CompanyVoiceDialog">
  55. update company_voice_dialog
  56. <trim prefix="SET" suffixOverrides=",">
  57. <if test="name != null">name = #{name},</if>
  58. <if test="resultName != null">result_name = #{resultName},</if>
  59. <if test="resultId != null">result_id = #{resultId},</if>
  60. <if test="callNum != null">call_num = #{callNum},</if>
  61. <if test="remark != null">remark = #{remark},</if>
  62. <if test="createTime != null">create_time = #{createTime},</if>
  63. <if test="createUser != null">create_user = #{createUser},</if>
  64. </trim>
  65. where id = #{id}
  66. </update>
  67. <delete id="deleteCompanyVoiceDialogById" parameterType="Long">
  68. delete from company_voice_dialog where id = #{id}
  69. </delete>
  70. <delete id="deleteCompanyVoiceDialogByIds" parameterType="String">
  71. delete from company_voice_dialog where id in
  72. <foreach item="id" collection="array" open="(" separator="," close=")">
  73. #{id}
  74. </foreach>
  75. </delete>
  76. </mapper>