CompanyWxDialogMapper.xml 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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.CompanyWxDialogMapper">
  6. <resultMap type="CompanyWxDialog" id="CompanyWxDialogResult">
  7. <result property="id" column="id" />
  8. <result property="name" column="name" />
  9. <result property="templateDetails" column="template_details" />
  10. <result property="createTime" column="create_time" />
  11. </resultMap>
  12. <sql id="selectCompanyWxDialogVo">
  13. select * from company_wx_dialog
  14. </sql>
  15. <select id="selectCompanyWxDialogList" parameterType="CompanyWxDialog" resultMap="CompanyWxDialogResult">
  16. <include refid="selectCompanyWxDialogVo"/>
  17. <where>
  18. <if test="companyId != null"> and company_id = #{companyId}</if>
  19. <if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
  20. <if test="templateDetails != null and templateDetails != ''"> and template_details = #{templateDetails}</if>
  21. </where>
  22. </select>
  23. <select id="selectCompanyWxDialogById" parameterType="Long" resultMap="CompanyWxDialogResult">
  24. <include refid="selectCompanyWxDialogVo"/>
  25. where id = #{id}
  26. </select>
  27. <insert id="insertCompanyWxDialog" parameterType="CompanyWxDialog" useGeneratedKeys="true" keyProperty="id">
  28. insert into company_wx_dialog
  29. <trim prefix="(" suffix=")" suffixOverrides=",">
  30. <if test="name != null">name,</if>
  31. <if test="templateDetails != null">template_details,</if>
  32. <if test="createTime != null">create_time,</if>
  33. <if test="createUser != null">create_user,</if>
  34. </trim>
  35. <trim prefix="values (" suffix=")" suffixOverrides=",">
  36. <if test="name != null">#{name},</if>
  37. <if test="templateDetails != null">#{templateDetails},</if>
  38. <if test="createTime != null">#{createTime},</if>
  39. <if test="createUser != null">#{createUser},</if>
  40. </trim>
  41. </insert>
  42. <update id="updateCompanyWxDialog" parameterType="CompanyWxDialog">
  43. update company_wx_dialog
  44. <trim prefix="SET" suffixOverrides=",">
  45. <if test="name != null">name = #{name},</if>
  46. <if test="templateDetails != null">template_details = #{templateDetails},</if>
  47. </trim>
  48. where id = #{id}
  49. </update>
  50. <delete id="deleteCompanyWxDialogById" parameterType="Long">
  51. delete from company_wx_dialog where id = #{id}
  52. </delete>
  53. <delete id="deleteCompanyWxDialogByIds" parameterType="String">
  54. delete from company_wx_dialog where id in
  55. <foreach item="id" collection="array" open="(" separator="," close=")">
  56. #{id}
  57. </foreach>
  58. </delete>
  59. </mapper>