| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE mapper
- PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
- "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.jzg.mapper.SysSystemMapper">
- <resultMap id="SysSystemResult" type="com.jzg.commons.entity.po.SysSystem">
- <id property="id" column="id" jdbcType="VARCHAR"/>
- <result property="parentId" column="parent_id" jdbcType="VARCHAR"/>
- <result property="isTenant" column="is_tenant" jdbcType="TINYINT"/>
- <result property="sysCode" column="sys_code" jdbcType="VARCHAR"/>
- <result property="sysName" column="sys_name" jdbcType="VARCHAR"/>
- <result property="shortName" column="short_name" jdbcType="VARCHAR"/>
- <result property="userId" column="user_id" jdbcType="VARCHAR"/>
- <result property="sysIcon" column="sys_icon" jdbcType="VARCHAR"/>
- <result property="sysType" column="sys_type" jdbcType="TINYINT"/>
- <result property="available" column="available" jdbcType="TINYINT"/>
- <result property="provinceId" column="province_id" jdbcType="VARCHAR"/>
- <result property="cityId" column="city_id" jdbcType="VARCHAR"/>
- <result property="districtId" column="district_id" jdbcType="VARCHAR"/>
- <result property="address" column="address" jdbcType="VARCHAR"/>
- <result property="contact" column="contact" jdbcType="VARCHAR"/>
- <result property="telephone" column="telephone" jdbcType="VARCHAR"/>
- <result property="contactAdress" column="contact_adress" jdbcType="VARCHAR"/>
- <result property="contactJob" column="contact_job" jdbcType="VARCHAR"/>
- <result property="businessSize" column="business_size" jdbcType="INTEGER"/>
- <result property="legalName" column="legal_name" jdbcType="VARCHAR"/>
- <result property="createBy" column="create_by" jdbcType="VARCHAR"/>
- <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
- <result property="updateBy" column="update_by" jdbcType="VARCHAR"/>
- <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
- <result property="isDelete" column="is_delete" jdbcType="TINYINT"/>
- </resultMap>
- <sql id="selectSystemVo">
- select id,parent_id,is_tenant,
- sys_code,sys_name,short_name,
- user_id,sys_icon,sys_type,
- available,province_id,city_id,
- district_id,address,contact,
- telephone,contact_adress,contact_job,
- business_size,legal_name,create_by,
- create_time,update_by,update_time,
- is_delete
- from sys_system
- </sql>
- <select id="queryPage" resultType="com.jzg.commons.entity.vo.SysSystemVo">
- <include refid="selectSystemVo"/>
- <where>
- <if test="sysSystemVo.provinceId != null and sysSystemVo.provinceId != ''">
- and province_id = #{sysSystemVo.provinceId}
- </if>
- <if test="sysSystemVo.cityId != null and sysSystemVo.cityId != ''">
- and city_id = #{sysSystemVo.cityId}
- </if>
- <if test="sysSystemVo.districtId != null and sysSystemVo.districtId != ''">
- and district_id = #{sysSystemVo.districtId}
- </if>
- <if test="sysSystemVo.sysType != null">
- and sys_type = #{sysSystemVo.sysType}
- </if>
- <if test="sysSystemVo.searchValue != null and sysSystemVo.searchValue != ''">
- and ( sys_name = #{sysSystemVo.searchValue} or sys_code = #{sysSystemVo.searchValue})
- </if>
- <if test="sysSystemVo.contactValue != null and sysSystemVo.contactValue != ''">
- and ( contact = #{sysSystemVo.contactValue} or telephone = #{sysSystemVo.contactValue})
- </if>
- and is_tenant = 1 and parent_id <![CDATA[ <> ]]> '0' and is_delete = 0
- </where>
- ORDER BY create_time DESC
- </select>
- <select id="queryList" resultType="com.jzg.commons.entity.vo.SysSystemVo">
- <include refid="selectSystemVo"/>
- <where>
- <if test="sysSystemVo.searchValue != null and sysSystemVo.searchValue != ''">
- AND (
- sys_name LIKE concat('%', #{sysSystemVo.searchValue}, '%')
- OR sys_code LIKE concat('%', #{sysSystemVo.searchValue}, '%')
- )
- </if>
- and is_tenant = 1 and parent_id <![CDATA[ <> ]]> '0' and is_delete = 0
- </where>
- ORDER BY create_time DESC
- </select>
- <select id="getCompanyList" resultType="com.jzg.commons.entity.po.EsmInsCompany">
- SELECT
- eic.id,
- eic.code,
- eic.company_code,
- eic.name,
- eic.parent_id,
- eic.name_simple,
- eic.remark,
- eic.order_num,
- eic.cn_name,
- eic.type,
- count(psi.id) as count,
- suf.file_name as logo
- FROM
- esm_ins_company eic
- left join sys_upload_files suf on eic.logo = suf.id
- left join ptl_scheme ps on eic.id = ps.company_id
- left join ptl_scheme_info psi on ps.id = psi.scheme_id
- WHERE
- eic.parent_id = 0
- AND
- eic.is_delete = 0
- <if test="companyIds != null and companyIds.size() > 0">
- and eic.id in
- <foreach collection="companyIds" item="item" index="index" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- group by eic.id
- order by count desc
- </select>
- </mapper>
|