TransactionItemMapper.xml 1.5 KB

123456789101112131415161718192021222324252627282930313233343536
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.crm.manager.dao.mapper.TransactionItemMapper">
  6. <sql id="transactionItemWhere">
  7. <where>
  8. <if test="senderAddress != null and senderAddress != ''">
  9. and ti.`sender_address` LIKE CONCAT('%', #{senderAddress}, '%')
  10. </if>
  11. <if test="recipientAddress != null and recipientAddress != ''">
  12. and ti.`recipient_address` LIKE CONCAT('%', #{recipientAddress}, '%')
  13. </if>
  14. <if test="senderLabel != null and senderLabel != ''">
  15. and ti.`sender_label` LIKE CONCAT('%', #{senderLabel}, '%')
  16. </if>
  17. <if test="recipientLabel != null and recipientLabel != ''">
  18. and ti.`recipient_label` LIKE CONCAT('%', #{recipientLabel}, '%')
  19. </if>
  20. <if test="vaultId != null and vaultId != ''">
  21. and ti.`vault_id` = #{vaultId}
  22. </if>
  23. </where>
  24. </sql>
  25. <select id="countList" resultType="java.lang.Integer">
  26. select count(*) from transaction_item ti
  27. <include refid="transactionItemWhere"/>
  28. </select>
  29. <select id="pageList" resultType="com.crm.rely.backend.model.pojo.table.TransactionItemTable">
  30. select * from transaction_item ti
  31. <include refid="transactionItemWhere"/>
  32. </select>
  33. </mapper>