RecSaleInfoMapper.xml 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  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.ruoyi.framework.recovery.mapper.RecSaleInfoMapper">
  6. <resultMap type="RecSaleInfo" id="RecSaleInfoResult">
  7. <result property="id" column="id" />
  8. <result property="saleName" column="sale_name" />
  9. <result property="salePrice" column="sale_price" />
  10. <result property="market" column="market" />
  11. <result property="storeId" column="store_id" />
  12. <result property="createBy" column="create_by" />
  13. <result property="createDate" column="create_date" />
  14. <result property="updateBy" column="update_by" />
  15. <result property="updateDate" column="update_date" />
  16. <result property="catalog" column="catalog" />
  17. <result property="images" column="images" />
  18. <result property="eventStartTime" column="event_start_time" />
  19. <result property="endTimeOfActivity" column="end_time_of_activity" />
  20. </resultMap>
  21. <sql id="selectRecSaleInfoVo">
  22. select id, sale_name,catalog, sale_price, market, store_id, create_by, create_date, update_by, update_date,
  23. images, event_start_time, end_time_of_activity from rec_sale_info
  24. </sql>
  25. <select id="selectRecSaleInfoList" parameterType="RecSaleInfo" resultMap="RecSaleInfoResult">
  26. <include refid="selectRecSaleInfoVo"/>
  27. <where>
  28. <if test="saleName != null and saleName != ''"> and sale_name like concat('%', #{saleName}, '%')</if>
  29. <if test="salePrice != null and salePrice != ''"> and sale_price = #{salePrice}</if>
  30. <if test="market != null and market != ''"> and market = #{market}</if>
  31. <if test="storeId != null and storeId != ''"> and store_id = #{storeId}</if>
  32. <if test="createDate != null "> and create_date = #{createDate}</if>
  33. <if test="updateDate != null "> and update_date = #{updateDate}</if>
  34. <if test="catalog != null "> and catalog = #{catalog}</if>
  35. <if test="images != null "> and images = #{images}</if>
  36. <if test="eventStartTime != null "> and event_start_time = #{eventStartTime}</if>
  37. <if test="endTimeOfActivity != null "> and end_time_of_activity = #{endTimeOfActivity}</if>
  38. </where>
  39. </select>
  40. <select id="selectRecSaleInfoById" parameterType="Long" resultMap="RecSaleInfoResult">
  41. <include refid="selectRecSaleInfoVo"/>
  42. where id = #{id}
  43. </select>
  44. <insert id="insertRecSaleInfo" parameterType="RecSaleInfo">
  45. insert into rec_sale_info
  46. <trim prefix="(" suffix=")" suffixOverrides=",">
  47. <if test="id != null">id,</if>
  48. <if test="saleName != null">sale_name,</if>
  49. <if test="salePrice != null">sale_price,</if>
  50. <if test="market != null">market,</if>
  51. <if test="storeId != null">store_id,</if>
  52. <if test="createBy != null">create_by,</if>
  53. <if test="createDate != null">create_date,</if>
  54. <if test="updateBy != null">update_by,</if>
  55. <if test="updateDate != null">update_date,</if>
  56. <if test="catalog != null">catalog,</if>
  57. <if test="images != null">images,</if>
  58. <if test="eventStartTime != null">event_start_time,</if>
  59. <if test="endTimeOfActivity != null">end_time_of_activity,</if>
  60. </trim>
  61. <trim prefix="values (" suffix=")" suffixOverrides=",">
  62. <if test="id != null">#{id},</if>
  63. <if test="saleName != null">#{saleName},</if>
  64. <if test="salePrice != null">#{salePrice},</if>
  65. <if test="market != null">#{market},</if>
  66. <if test="storeId != null">#{storeId},</if>
  67. <if test="createBy != null">#{createBy},</if>
  68. <if test="createDate != null">#{createDate},</if>
  69. <if test="updateBy != null">#{updateBy},</if>
  70. <if test="updateDate != null">#{updateDate},</if>
  71. <if test="catalog != null">#{catalog},</if>
  72. <if test="images != null">#{images},</if>
  73. <if test="eventStartTime != null">#{eventStartTime},</if>
  74. <if test="endTimeOfActivity != null">#{endTimeOfActivity},</if>
  75. </trim>
  76. </insert>
  77. <update id="updateRecSaleInfo" parameterType="RecSaleInfo">
  78. update rec_sale_info
  79. <trim prefix="SET" suffixOverrides=",">
  80. <if test="saleName != null">sale_name = #{saleName},</if>
  81. <if test="salePrice != null">sale_price = #{salePrice},</if>
  82. <if test="market != null">market = #{market},</if>
  83. <if test="storeId != null">store_id = #{storeId},</if>
  84. <if test="createBy != null">create_by = #{createBy},</if>
  85. <if test="createDate != null">create_date = #{createDate},</if>
  86. <if test="updateBy != null">update_by = #{updateBy},</if>
  87. <if test="updateDate != null">update_date = #{updateDate},</if>
  88. <if test="catalog != null">update_date = #{catalog},</if>
  89. <if test="images != null">images = #{images},</if>
  90. <if test="eventStartTime != null">event_start_time = #{eventStartTime},</if>
  91. <if test="endTimeOfActivity != null">end_time_of_activity = #{endTimeOfActivity},</if>
  92. </trim>
  93. where id = #{id}
  94. </update>
  95. <delete id="deleteRecSaleInfoById" parameterType="Long">
  96. delete from rec_sale_info where id = #{id}
  97. </delete>
  98. <delete id="deleteRecSaleInfoByIds" parameterType="String">
  99. delete from rec_sale_info where id in
  100. <foreach item="id" collection="array" open="(" separator="," close=")">
  101. #{id}
  102. </foreach>
  103. </delete>
  104. <select id="selectRecSaleInfoByTime" resultType="com.ruoyi.framework.recovery.domain.RecSaleInfo">
  105. <include refid="selectRecSaleInfoVo"/>
  106. where (create_time between #{start,jdbcType=TIMESTAMP} and #{end,jdbcType=TIMESTAMP})
  107. or (event_start_time &lt; #{start,jdbcType=TIMESTAMP} and end_time_of_activity >= #{end,jdbcType=TIMESTAMP})
  108. </select>
  109. </mapper>