后台服务
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.

WxOrderPressMapper.xml 3.0 KiB

2 jaren geleden
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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.WxOrderPressMapper">
  4. <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxOrderPress">
  5. <id column="id" jdbcType="BIGINT" property="id" />
  6. <result column="tenant_id" jdbcType="VARCHAR" property="tenantId" />
  7. <result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId" />
  8. <result column="coupon_id" jdbcType="BIGINT" property="couponId" />
  9. <result column="order_id" jdbcType="BIGINT" property="orderId" />
  10. <result column="user_id" jdbcType="BIGINT" property="userId" />
  11. <result column="press_value" jdbcType="INTEGER" property="pressValue" />
  12. <result column="create_date" jdbcType="TIMESTAMP" property="createDate" />
  13. <result column="first" jdbcType="SMALLINT" property="first" />
  14. </resultMap>
  15. <sql id="allColumns">
  16. `id`,`tenant_id`,`parent_tenant_id`,`coupon_id`,`order_id`,`user_id`,`press_value`,`create_date`,`first`
  17. </sql>
  18. <sql id="dynamicWhereConditions">
  19. where `tenant_id` = #{tenantId}
  20. <if test=" null != id ">
  21. and `id` = #{id}
  22. </if>
  23. <if test=" null != parentTenantId and '' != parentTenantId">
  24. and `parent_tenant_id` = #{parentTenantId}
  25. </if>
  26. <if test=" null != orderId ">
  27. and `order_id` = #{orderId}
  28. </if>
  29. <if test=" null != userId ">
  30. and `user_id` = #{userId}
  31. </if>
  32. <if test=" null != pressValue ">
  33. and `press_value` = #{pressValue}
  34. </if>
  35. <if test=" null != createDate ">
  36. and `create_date` = #{createDate}
  37. </if>
  38. <if test=" null != couponIds ">
  39. and coupon_id in
  40. <foreach collection="couponIds" index="index" item="cIdItem" open="(" separator="," close=")">
  41. #{cIdItem}
  42. </foreach>
  43. </if>
  44. <if test=" null != ids ">
  45. and id in
  46. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  47. #{idItem}
  48. </foreach>
  49. </if>
  50. <if test=" null != sortColumns"> order by ${sortColumns} </if>
  51. </sql>
  52. <select id="selectById" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  53. select <include refid="allColumns" /> from wx_order_press where id = #{id} and tenant_id = #{tenantId}
  54. </select>
  55. <select id="findList" parameterType="com.iformall.domain.po.WxOrderPress" resultMap="BaseResultMap">
  56. select <include refid="allColumns" /> from wx_order_press
  57. <include refid="dynamicWhereConditions" />
  58. </select>
  59. <select id="findPressList" parameterType="com.iformall.domain.vo.WxOrderPressVo" resultMap="BaseResultMap">
  60. select <include refid="allColumns" />
  61. from wx_order_press op
  62. where op.`order_id` = #{orderId} and op.tenant_id = #{tenantId}
  63. order by op.`create_date` desc
  64. </select>
  65. <select id="findCount" parameterType="com.iformall.domain.po.WxOrderPress" resultType="Integer">
  66. select count(1) from wx_order_press
  67. <include refid="dynamicWhereConditions" />
  68. </select>
  69. </mapper>