Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
 
 
 
 
 

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