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.
 
 
 
 
 

72 lines
2.3 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.WxBillActionMapper">
  4. <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxBillAction">
  5. <id column="id" jdbcType="BIGINT" property="id"/>
  6. <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
  7. <result column="bill_id" jdbcType="BIGINT" property="billId"/>
  8. <result column="user_id" jdbcType="BIGINT" property="userId"/>
  9. <result column="user_name" jdbcType="VARCHAR" property="userName"/>
  10. <result column="phone" jdbcType="VARCHAR" property="phone"/>
  11. <result column="action" jdbcType="INTEGER" property="action"/>
  12. <result column="details" jdbcType="VARCHAR" property="details"/>
  13. <result column="createtime" jdbcType="TIMESTAMP" property="createtime"/>
  14. <result column="updatetime" jdbcType="TIMESTAMP" property="updatetime"/>
  15. <result column="pay_date" jdbcType="TIMESTAMP" property="payDate"/>
  16. </resultMap>
  17. <sql id="allColumns">
  18. `id`,`tenant_id`,`bill_id`,`user_id`,`user_name`,`phone`,`action`,`details`,`createtime`,`updatetime`,`pay_date`
  19. </sql>
  20. <sql id="dynamicWhereConditions">
  21. where 1=1
  22. <if test=" null != id ">
  23. and `id` = #{id}
  24. </if>
  25. <if test=" null != action ">
  26. and `action` = #{action}
  27. </if>
  28. <if test="null == action ">
  29. and `action` != 7
  30. </if>
  31. <if test=" null != billId ">
  32. and `bill_id` = #{billId}
  33. </if>
  34. <if test=" null != startDate and null != endDate">
  35. and `createtime` BETWEEN startDate and endDate
  36. </if>
  37. <if test=" null != ids ">
  38. and id in
  39. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  40. #{idItem}
  41. </foreach>
  42. </if>
  43. <if test=" null != sortColumns">order by ${sortColumns}</if>
  44. <if test=" null == sortColumns">order by createtime desc</if>
  45. </sql>
  46. <select id="findList" parameterType="com.iformall.domain.po.WxBillAction" resultMap="BaseResultMap">
  47. select
  48. <include refid="allColumns"/>
  49. from wx_bill_action
  50. <include refid="dynamicWhereConditions"/>
  51. </select>
  52. <select id="findBillActionList" parameterType="com.iformall.domain.po.WxBillAction" resultMap="BaseResultMap">
  53. select
  54. <include refid="allColumns"/>
  55. from wx_bill_action
  56. <include refid="dynamicWhereConditions"/>
  57. </select>
  58. </mapper>