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.
 
 
 
 
 

84 lines
3.1 KiB

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