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.
 
 
 
 
 

67 lines
2.4 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.WxPrepaymentMapper">
  4. <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxPrepayment">
  5. <id column="id" property="id"/>
  6. <result column="tenant_id" property="tenantId"/>
  7. <result column="merchant_id" property="merchantId"/>
  8. <result column="last_pay_type" property="lastPayType"/>
  9. <result column="last_pay_way" property="lastPayWay"/>
  10. <result column="last_pay_amount" property="lastPayAmount"/>
  11. <result column="remain_amount" property="remainAmount"/>
  12. <result column="total_amount" property="totalAmount"/>
  13. <result column="remarks" property="remarks"/>
  14. <result column="operation_type" property="operationType"/>
  15. <result column="operator" property="operator"/>
  16. <result column="create_time" property="createTime"/>
  17. <result column="update_time" property="updateTime"/>
  18. <result column="merchant_name" property="merchantName"/>
  19. </resultMap>
  20. <sql id="allColumns">
  21. p.`id`,p.`tenant_id`,p.`merchant_id`,p.`last_pay_way`,p.`last_pay_type`,p.`last_pay_amount`,p.`remain_amount`,p.`total_amount` ,p.`remarks`,p.`operation_type`,p.`operator`,
  22. p.`create_time`,p.`update_time`,m.`name` merchant_name
  23. </sql>
  24. <sql id="dynamicWhereConditions">
  25. where 1 = 1
  26. <if test=" null != tenantId ">
  27. and p.`tenant_id` = #{tenantId}
  28. </if>
  29. <if test=" null != id ">
  30. and p.`id` = #{id}
  31. </if>
  32. <if test=" null != merchantId ">
  33. and p.`merchant_id` = #{merchantId}
  34. </if>
  35. <if test=" null != lastPayType ">
  36. and p.`last_pay_type` = #{lastPayType}
  37. </if>
  38. <if test=" null != lastPayWay ">
  39. and p.`last_pay_way` = #{lastPayWay}
  40. </if>
  41. <if test=" null != operationType ">
  42. and p.`operation_type` = #{operationType}
  43. </if>
  44. <if test=" null != merchantName and '' != merchantName">
  45. and m.`name` like concat('%',#{merchantName},'%')
  46. </if>
  47. <if test=" null != ids ">
  48. and p.id in
  49. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  50. #{idItem}
  51. </foreach>
  52. </if>
  53. <if test=" null != sortColumns">order by ${sortColumns}</if>
  54. </sql>
  55. <select id="findList" parameterType="com.iformall.domain.po.WxPrepayment" resultMap="BaseResultMap">
  56. select
  57. <include refid="allColumns"/>
  58. from wx_prepayment p inner join wx_merchant m on p.merchant_id=m.id
  59. <include refid="dynamicWhereConditions"/>
  60. </select>
  61. </mapper>