后台服务
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

WxFloatingLayerMapper.xml 3.9 KiB

2 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.iformall.mapper.WxFloatingLayerMapper">
  4. <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxFloatingLayer">
  5. <id column="id" jdbcType="BIGINT" property="id"/>
  6. <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
  7. <result column="cover_img" jdbcType="VARCHAR" property="coverImg"/>
  8. <result column="produce_id" jdbcType="BIGINT" property="produceId"/>
  9. <result column="page_path" jdbcType="VARCHAR" property="pagePath"/>
  10. <result column="status" jdbcType="INTEGER" property="status"/>
  11. <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
  12. <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
  13. </resultMap>
  14. <sql id="allColumns">
  15. `id`, `tenant_id` , `cover_img` , `produce_id`, `page_path` , `status`, `create_time`, `update_time`
  16. </sql>
  17. <sql id="dynamicWhereConditions">
  18. where 1 = 1
  19. <if test=" null != id ">
  20. and `id` = #{id}
  21. </if>
  22. <if test=" null != tenantId ">
  23. and `tenant_id` = #{tenantId}
  24. </if>
  25. <if test=" null != status ">
  26. and `status` = #{status}
  27. </if>
  28. <if test=" null != ids ">
  29. and id in
  30. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  31. #{idItem}
  32. </foreach>
  33. </if>
  34. <if test=" null != sortColumns">order by ${sortColumns}</if>
  35. </sql>
  36. <sql id="allColumnsVO">
  37. fl.`id` as id, fl.`tenant_id` , fl.`cover_img` , fl.`produce_id`,
  38. fl.`page_path` , fl.`status`, fl.`create_time` as create_time, fl.`update_time`,
  39. cc.title
  40. </sql>
  41. <select id="findList" parameterType="com.iformall.domain.po.WxFloatingLayer" resultMap="BaseResultMap">
  42. select
  43. <include refid="allColumns"/>
  44. from wx_floating_layer
  45. <include refid="dynamicWhereConditions"/>
  46. </select>
  47. <resultMap id="resultListVO" type="com.iformall.domain.vo.WxFloatingLayerVO">
  48. <id column="id" jdbcType="BIGINT" property="id"/>
  49. <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
  50. <result column="cover_img" jdbcType="VARCHAR" property="coverImg"/>
  51. <result column="produce_id" jdbcType="BIGINT" property="produceId"/>
  52. <result column="page_path" jdbcType="VARCHAR" property="pagePath"/>
  53. <result column="status" jdbcType="INTEGER" property="status"/>
  54. <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
  55. <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
  56. <result column="title" jdbcType="VARCHAR" property="title"/>
  57. </resultMap>
  58. <sql id="dynamicWhereConditionsVO">
  59. where 1=1
  60. <if test=" null != id ">
  61. and fl.`id` = #{id}
  62. </if>
  63. <if test=" null != tenantId ">
  64. and fl.`tenant_id` = #{tenantId}
  65. </if>
  66. <if test=" null != status ">
  67. and fl.`status` = #{status}
  68. </if>
  69. <if test=" null != ids ">
  70. and fl.id in
  71. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  72. #{idItem}
  73. </foreach>
  74. </if>
  75. <if test=" null != sortColumns">order by ${sortColumns}</if>
  76. </sql>
  77. <select id="findListVO" parameterType="com.iformall.domain.po.WxFloatingLayer" resultMap="resultListVO">
  78. select
  79. <include refid="allColumnsVO"/>
  80. from wx_floating_layer fl left join wx_coupon_channel cc on fl.produce_id=cc.id
  81. <include refid="dynamicWhereConditionsVO"/>
  82. </select>
  83. <update id="updateStatus">
  84. update wx_floating_layer set status=1 where produce_id=#{value}
  85. </update>
  86. </mapper>