SysSystemMapper.xml 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  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.jzg.mapper.SysSystemMapper">
  6. <resultMap id="SysSystemResult" type="com.jzg.commons.entity.po.SysSystem">
  7. <id property="id" column="id" jdbcType="VARCHAR"/>
  8. <result property="parentId" column="parent_id" jdbcType="VARCHAR"/>
  9. <result property="isTenant" column="is_tenant" jdbcType="TINYINT"/>
  10. <result property="sysCode" column="sys_code" jdbcType="VARCHAR"/>
  11. <result property="sysName" column="sys_name" jdbcType="VARCHAR"/>
  12. <result property="shortName" column="short_name" jdbcType="VARCHAR"/>
  13. <result property="userId" column="user_id" jdbcType="VARCHAR"/>
  14. <result property="sysIcon" column="sys_icon" jdbcType="VARCHAR"/>
  15. <result property="sysType" column="sys_type" jdbcType="TINYINT"/>
  16. <result property="available" column="available" jdbcType="TINYINT"/>
  17. <result property="provinceId" column="province_id" jdbcType="VARCHAR"/>
  18. <result property="cityId" column="city_id" jdbcType="VARCHAR"/>
  19. <result property="districtId" column="district_id" jdbcType="VARCHAR"/>
  20. <result property="address" column="address" jdbcType="VARCHAR"/>
  21. <result property="contact" column="contact" jdbcType="VARCHAR"/>
  22. <result property="telephone" column="telephone" jdbcType="VARCHAR"/>
  23. <result property="contactAdress" column="contact_adress" jdbcType="VARCHAR"/>
  24. <result property="contactJob" column="contact_job" jdbcType="VARCHAR"/>
  25. <result property="businessSize" column="business_size" jdbcType="INTEGER"/>
  26. <result property="legalName" column="legal_name" jdbcType="VARCHAR"/>
  27. <result property="createBy" column="create_by" jdbcType="VARCHAR"/>
  28. <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
  29. <result property="updateBy" column="update_by" jdbcType="VARCHAR"/>
  30. <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
  31. <result property="isDelete" column="is_delete" jdbcType="TINYINT"/>
  32. </resultMap>
  33. <sql id="selectSystemVo">
  34. select id,parent_id,is_tenant,
  35. sys_code,sys_name,short_name,
  36. user_id,sys_icon,sys_type,
  37. available,province_id,city_id,
  38. district_id,address,contact,
  39. telephone,contact_adress,contact_job,
  40. business_size,legal_name,create_by,
  41. create_time,update_by,update_time,
  42. is_delete
  43. from sys_system
  44. </sql>
  45. <select id="queryPage" resultType="com.jzg.commons.entity.vo.SysSystemVo">
  46. <include refid="selectSystemVo"/>
  47. <where>
  48. <if test="sysSystemVo.provinceId != null and sysSystemVo.provinceId != ''">
  49. and province_id = #{sysSystemVo.provinceId}
  50. </if>
  51. <if test="sysSystemVo.cityId != null and sysSystemVo.cityId != ''">
  52. and city_id = #{sysSystemVo.cityId}
  53. </if>
  54. <if test="sysSystemVo.districtId != null and sysSystemVo.districtId != ''">
  55. and district_id = #{sysSystemVo.districtId}
  56. </if>
  57. <if test="sysSystemVo.sysType != null">
  58. and sys_type = #{sysSystemVo.sysType}
  59. </if>
  60. <if test="sysSystemVo.searchValue != null and sysSystemVo.searchValue != ''">
  61. and ( sys_name = #{sysSystemVo.searchValue} or sys_code = #{sysSystemVo.searchValue})
  62. </if>
  63. <if test="sysSystemVo.contactValue != null and sysSystemVo.contactValue != ''">
  64. and ( contact = #{sysSystemVo.contactValue} or telephone = #{sysSystemVo.contactValue})
  65. </if>
  66. and is_tenant = 1 and parent_id <![CDATA[ <> ]]> '0' and is_delete = 0
  67. </where>
  68. ORDER BY create_time DESC
  69. </select>
  70. <select id="queryList" resultType="com.jzg.commons.entity.vo.SysSystemVo">
  71. <include refid="selectSystemVo"/>
  72. <where>
  73. <if test="sysSystemVo.searchValue != null and sysSystemVo.searchValue != ''">
  74. AND (
  75. sys_name LIKE concat('%', #{sysSystemVo.searchValue}, '%')
  76. OR sys_code LIKE concat('%', #{sysSystemVo.searchValue}, '%')
  77. )
  78. </if>
  79. and is_tenant = 1 and parent_id <![CDATA[ <> ]]> '0' and is_delete = 0
  80. </where>
  81. ORDER BY create_time DESC
  82. </select>
  83. <select id="getCompanyList" resultType="com.jzg.commons.entity.po.EsmInsCompany">
  84. SELECT
  85. eic.id,
  86. eic.code,
  87. eic.company_code,
  88. eic.name,
  89. eic.parent_id,
  90. eic.name_simple,
  91. eic.remark,
  92. eic.order_num,
  93. eic.cn_name,
  94. eic.type,
  95. count(psi.id) as count,
  96. suf.file_name as logo
  97. FROM
  98. esm_ins_company eic
  99. left join sys_upload_files suf on eic.logo = suf.id
  100. left join ptl_scheme ps on eic.id = ps.company_id
  101. left join ptl_scheme_info psi on ps.id = psi.scheme_id
  102. WHERE
  103. eic.parent_id = 0
  104. AND
  105. eic.is_delete = 0
  106. <if test="companyIds != null and companyIds.size() > 0">
  107. and eic.id in
  108. <foreach collection="companyIds" item="item" index="index" open="(" separator="," close=")">
  109. #{item}
  110. </foreach>
  111. </if>
  112. group by eic.id
  113. order by count desc
  114. </select>
  115. </mapper>