YhBjflZbMapper.xml 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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.tofly.feesapi.bjgl.mapper.YhBjflZbMapper">
  4. <resultMap id="yhBjflZbMap" type="com.tofly.feesapi.bjgl.entity.YhBjflZb">
  5. <id property="id" column="ID"/>
  6. <result property="yhbh" column="YHBH"/>
  7. <result property="cbkh" column="CBKH"/>
  8. <result property="typeId" column="TYPE_ID"/>
  9. <result property="jsfs" column="JSFS"/>
  10. <result property="isdisabled" column="ISDISABLED"/>
  11. <result property="czry" column="CZRY"/>
  12. <result property="czsj" column="CZSJ"/>
  13. <result property="czryxm" column="CZRYXM"/>
  14. </resultMap>
  15. <select id="getMaxid" resultType="java.lang.String">
  16. select max(id) + 1
  17. from yh_bjfl_zb
  18. </select>
  19. <select id="getPage" resultType="com.tofly.feesapi.bjgl.entity.vo.YhBjflZbSelect">
  20. select a.id,a.yhbh,a.cbkh,a.type_id typeId,a.jsfs,a.isdisabled,a.czry,a.czryxm,a.czsj,
  21. c.yhxm,c.yhdz,c.lxdh,
  22. count(b.id) fbsl
  23. from yh_bjfl_zb a
  24. left join yh_bjfl_fb b on a.id=b.zb_id
  25. left join yh_khjbxx c on a.yhbh=c.yhbh
  26. <where>
  27. <if test="filter.searchText!=null and filter.searchText != ''">
  28. AND ( a.yhbh like '%${filter.searchText}%'
  29. OR c.yhxm like '%${filter.searchText}%'
  30. OR c.yhdz like '%${filter.searchText}%'
  31. OR c.lxdh like '%${filter.searchText}%')
  32. </if>
  33. <if test="filter.yhbh != null and filter.yhbh != ''">
  34. and a.yhbh = #{filter.yhbh}
  35. </if>
  36. <if test="filter.typeId != null and filter.typeId != ''">
  37. and a.type_id = #{filter.typeId}
  38. </if>
  39. </where>
  40. group by a.id,a.yhbh,a.cbkh,a.type_id,a.jsfs,a.isdisabled,a.czry,a.czryxm,a.czsj,
  41. c.yhxm,c.yhdz,c.lxdh
  42. </select>
  43. </mapper>