YhGroupAccountsMapper.xml 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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.YhGroupAccountsMapper">
  4. <resultMap id="yhGroupAccountsMap" type="com.tofly.feesapi.yhgl.entity.YhGroupAccounts">
  5. <id property="id" column="ID"/>
  6. <result property="groupId" column="GROUP_ID"/>
  7. <result property="yhbh" column="YHBH"/>
  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_ACCOUNTS
  15. </select>
  16. <select id="getPage" resultType="com.tofly.feesapi.yhgl.entity.vo.YhGroupAccountsSelect">
  17. select a.id,
  18. a.group_id groupId,
  19. a.czry,
  20. a.czrymc,
  21. a.czsj,
  22. c1.yhbh yhbh,
  23. c1.yhxm yhmc,
  24. c1.yhdz yhdz,
  25. c1.lxdh lxdh,
  26. c2.yhbh groupYhbh,
  27. c2.yhxm groupYhmc,
  28. c2.yhdz groupYhdz,
  29. c2.lxdh groupLxdh
  30. from yh_group_accounts a
  31. left join yh_group b on a.group_id = b.id
  32. left join yh_khjbxx c1 on a.yhbh = c1.yhbh
  33. left join yh_khjbxx c2 on b.yhbh = c2.yhbh
  34. <where>
  35. <if test="filter.searchText != null and filter.searchText != ''">
  36. and (
  37. a.yhbh like '%${filter.searchText}%'
  38. or b.yhbh like '%${filter.searchText}%'
  39. or c1.yhxm like '%${filter.searchText}%'
  40. or c1.yhdz like '%${filter.searchText}%'
  41. or c1.lxdh like '%${filter.searchText}%'
  42. or c2.yhxm like '%${filter.searchText}%'
  43. or c2.yhdz like '%${filter.searchText}%'
  44. or c2.lxdh like '%${filter.searchText}%'
  45. )
  46. </if>
  47. <if test="filter.groupId != null and filter.groupId != ''">
  48. and a.group_id = #{filter.groupId}
  49. </if>
  50. <if test="filter.yhbh != null and filter.yhbh != ''">
  51. and a.yhbh = #{filter.yhbh}
  52. </if>
  53. </where>
  54. </select>
  55. </mapper>