LiveCompanyCodeMapper.xml 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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.live.mapper.LiveCompanyCodeMapper">
  6. <resultMap type="LiveCompanyCode" id="LiveCompanyCodeResult">
  7. <result property="id" column="id" />
  8. <result property="liveId" column="live_id" />
  9. <result property="companyId" column="company_id" />
  10. <result property="companyUserId" column="company_user_id" />
  11. <result property="liveCodeUrl" column="live_code_url" />
  12. <result property="createTime" column="create_time" />
  13. <result property="updateTime" column="update_time" />
  14. </resultMap>
  15. <sql id="selectLiveCompanyCodeVo">
  16. select id, live_id, company_id, company_user_id, live_code_url, create_time, update_time from live_company_code
  17. </sql>
  18. <select id="selectLiveCompanyCodeList" parameterType="LiveCompanyCode" resultMap="LiveCompanyCodeResult">
  19. <include refid="selectLiveCompanyCodeVo"/>
  20. <where>
  21. <if test="liveId != null "> and live_id = #{liveId}</if>
  22. <if test="companyId != null "> and company_id = #{companyId}</if>
  23. <if test="companyUserId != null "> and company_user_id = #{companyUserId}</if>
  24. <if test="liveCodeUrl != null and liveCodeUrl != ''"> and live_code_url = #{liveCodeUrl}</if>
  25. </where>
  26. </select>
  27. <select id="selectLiveCompanyCodeById" parameterType="Long" resultMap="LiveCompanyCodeResult">
  28. <include refid="selectLiveCompanyCodeVo"/>
  29. where id = #{id}
  30. </select>
  31. <insert id="insertLiveCompanyCode" parameterType="LiveCompanyCode">
  32. insert into live_company_code
  33. <trim prefix="(" suffix=")" suffixOverrides=",">
  34. <if test="id != null">id,</if>
  35. <if test="liveId != null">live_id,</if>
  36. <if test="companyId != null">company_id,</if>
  37. <if test="companyUserId != null">company_user_id,</if>
  38. <if test="liveCodeUrl != null">live_code_url,</if>
  39. <if test="createTime != null">create_time,</if>
  40. <if test="updateTime != null">update_time,</if>
  41. </trim>
  42. <trim prefix="values (" suffix=")" suffixOverrides=",">
  43. <if test="id != null">#{id},</if>
  44. <if test="liveId != null">#{liveId},</if>
  45. <if test="companyId != null">#{companyId},</if>
  46. <if test="companyUserId != null">#{companyUserId},</if>
  47. <if test="liveCodeUrl != null">#{liveCodeUrl},</if>
  48. <if test="createTime != null">#{createTime},</if>
  49. <if test="updateTime != null">#{updateTime},</if>
  50. </trim>
  51. </insert>
  52. <update id="updateLiveCompanyCode" parameterType="LiveCompanyCode">
  53. update live_company_code
  54. <trim prefix="SET" suffixOverrides=",">
  55. <if test="liveId != null">live_id = #{liveId},</if>
  56. <if test="companyId != null">company_id = #{companyId},</if>
  57. <if test="companyUserId != null">company_user_id = #{companyUserId},</if>
  58. <if test="liveCodeUrl != null">live_code_url = #{liveCodeUrl},</if>
  59. <if test="createTime != null">create_time = #{createTime},</if>
  60. <if test="updateTime != null">update_time = #{updateTime},</if>
  61. </trim>
  62. where id = #{id}
  63. </update>
  64. <delete id="deleteLiveCompanyCodeById" parameterType="Long">
  65. delete from live_company_code where id = #{id}
  66. </delete>
  67. <delete id="deleteLiveCompanyCodeByIds" parameterType="String">
  68. delete from live_company_code where id in
  69. <foreach item="id" collection="array" open="(" separator="," close=")">
  70. #{id}
  71. </foreach>
  72. </delete>
  73. </mapper>