YhGroupMapper.xml 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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.yhgl.mapper.YhGroupMapper">
  4. <resultMap id="yhGroupMap" type="com.tofly.feesapi.yhgl.entity.YhGroup">
  5. <id property="id" column="ID"/>
  6. <result property="yhbh" column="YHBH"/>
  7. <result property="isdisabled" column="ISDISABLED"/>
  8. <result property="czry" column="CZRY"/>
  9. <result property="czrymc" column="CZRYMC"/>
  10. <result property="czsj" column="CZSJ"/>
  11. </resultMap>
  12. <select id="getMaxid" resultType="java.lang.String">
  13. select max(ID) + 1
  14. from YH_GROUP
  15. </select>
  16. <select id="getPage" resultType="com.tofly.feesapi.yhgl.entity.vo.YhGroupSelect">
  17. select a.id,
  18. a.yhbh,
  19. a.isdisabled,
  20. a.czry,
  21. a.czrymc,
  22. a.czsj,
  23. b.yhxm,
  24. b.yhdz,
  25. b.lxdh,
  26. count(c.id) yhsl
  27. from yh_group a
  28. left join yh_group_accounts c on a.id = c.group_id
  29. left join yh_khjbxx b on a.yhbh = b.yhbh
  30. <where>
  31. <if test="filter.searchText != null and filter.searchText != ''">
  32. and (
  33. a.yhbh like '%${filter.searchText}%'
  34. or b.yhxm like '%${filter.searchText}%'
  35. or b.yhdz like '%${filter.searchText}%'
  36. or b.lxdh like '%${filter.searchText}%'
  37. )
  38. </if>
  39. <if test="filter.yhbh != null and filter.yhbh != ''">
  40. and a.yhbh = #{filter.yhbh}
  41. </if>
  42. </where>
  43. group by a.id,
  44. a.yhbh,
  45. a.isdisabled,
  46. a.czry,
  47. a.czrymc,
  48. a.czsj,
  49. b.yhxm,
  50. b.yhdz,
  51. b.lxdh
  52. </select>
  53. </mapper>