CompanyWxDialogMapper.xml 2.8 KB

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