| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162 |
- <?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.JyxConfigMapper">
- <resultMap id="jyxConfigVo" type="com.jzg.commons.entity.vo.JyxConfigVo">
- <id column="id" property="id"/>
- <result column="product_type" property="productType"/>
- <result column="parent_id" property="parentId"/>
- <result column="product_name" property="productName"/>
- <result column="alias" property="alias"/>
- <result column="company" property="company"/>
- <result column="product_code" property="productCode"/>
- <result column="connection_method" property="connectionMethod"/>
- <result column="premium_setting" property="premiumSetting"/>
- <result column="jsCoverage" property="coverage"/>
- <result column="jsPremium" property="premium"/>
- <result column="system_code" property="systemCode"/>
- <result column="jcDelete" property="isDelete"/>
- <collection property="blameList" ofType="com.jzg.commons.entity.po.JyxBlame">
- <id column="blame_id" property="id"/>
- <result column="blame" property="blame"/>
- <result column="blame_code" property="blameCode"/>
- <result column="blame_coverage" property="blameCoverage"/>
- <result column="blame_premium" property="blamePremium"/>
- <result column="blame_system_code" property="systemCode"/>
- <result column="blame_jyx_config_id" property="jyxConfigId"/>
- </collection>
- <collection property="settingList" ofType="com.jzg.commons.entity.po.jyxSetting">
- <id column="setting_id" property="id"/>
- <result column="seats" property="seats"/>
- <result column="setting_coverage" property="coverage"/>
- <result column="setting_premium" property="premium"/>
- <result column="setting_system_code" property="systemCode"/>
- <result column="setting_jyx_config_id" property="jyxConfigId"/>
- </collection>
- </resultMap>
- <sql id="params">
- jc.`id`, jc.`product_type`,jc.`parent_id`,
- CASE WHEN jc.parent_id != '0' AND jc.parent_id IS NOT NULL AND jc1.product_name IS NOT NULL THEN CONCAT(jc1.product_name, '-', jc.product_name) ELSE jc.product_name END as product_name,
- jc.`alias`,jc.`company`, jc.`product_code`,jc.`connection_method`,jc.`premium_setting`, jc.`coverage` as jsCoverage, jc.`premium` as jsPremium, jc.`system_code`, jc.`is_delete` as isDelete
- </sql>
- <select id="jyxList" resultMap="jyxConfigVo">
- select
- <include refid="params"/> ,
- jb.id as blame_id,jb.blame,jb.blame_code,jb.blame_coverage,jb.blame_premium,jb.system_code as blame_system_code,jb.jyx_config_id as blame_jyx_config_id,
- js.id as setting_id,js.seats,js.coverage as setting_coverage,js.premium as setting_premium,js.system_code as setting_system_code,js.jyx_config_id as setting_jyx_config_id
- from jyx_config jc
- left join jyx_config jc1 on jc.parent_id = jc1.id AND jc1.is_delete = 0
- left join jyx_blame jb on jc.id = jb.jyx_config_id AND jb.is_delete = 0
- left join jyx_setting js on jc.id = js.jyx_config_id AND js.is_delete = 0
- <where>
- jc.is_delete = 0
- <if test="params != null and params != ''">
- and (jc.product_name like concat('%',#{params},'%') or jc.alias like concat('%',#{params},'%'))
- </if>
- <if test="seats != null and seats != ''">
- and js.seats = #{seats}
- </if>
- <if test="company != null and company != ''">
- and jc.company = #{company}
- </if>
- <if test="parentId == 0">
- and jc.parent_id = 0
- </if>
- <if test="parentId == null and parentId == ''">
- and jc.parent_id != 0
- </if>
- </where>
- order by jc.create_time desc
- </select>
- <select id="selectIds" resultMap="jyxConfigVo">
- select
- <include refid="params"/> ,
- jb.id as blame_id,jb.blame,jb.blame_code,jb.blame_coverage,jb.blame_premium,jb.system_code as blame_system_code,jb.jyx_config_id as blame_jyx_config_id,
- js.id as setting_id,js.seats,js.coverage as setting_coverage,js.premium as setting_premium,js.system_code as setting_system_code,js.jyx_config_id as setting_jyx_config_id
- from jyx_config jc
- left join jyx_blame jb on jc.id = jb.jyx_config_id AND jb.is_delete = 0
- left join jyx_setting js on jc.id = js.jyx_config_id AND js.is_delete = 0
- <where>
- jc.is_delete = 0
- <if test="ids != null and ids != ''">
- and jc.id in
- <foreach collection="ids" item="id" open="(" separator="," close=")">
- #{id}
- </foreach>
- </if>
- </where>
- order by jc.create_time desc
- </select>
- <select id="selectParentIds" resultMap="jyxConfigVo">
- select
- <include refid="params"/> ,
- jb.id as blame_id,jb.blame,jb.blame_code,jb.blame_coverage,jb.blame_premium,jb.system_code as blame_system_code,jb.jyx_config_id as blame_jyx_config_id,
- js.id as setting_id,js.seats,js.coverage as setting_coverage,js.premium as setting_premium,js.system_code as setting_system_code,js.jyx_config_id as setting_jyx_config_id
- from jyx_config jc
- left join jyx_blame jb on jc.id = jb.jyx_config_id AND jb.is_delete = 0
- left join jyx_setting js on jc.id = js.jyx_config_id AND js.is_delete = 0
- <where>
- jc.is_delete = 0
- <if test="ids != null and ids != ''">
- and jc.id in
- <foreach collection="ids" item="id" open="(" separator="," close=")">
- #{id}
- </foreach>
- </if>
- </where>
- order by jc.create_time desc
- </select>
- <select id="selectMainInsurance" resultType="com.jzg.commons.entity.vo.JyxConfigVo">
- select
- jc.`id`,
- jc.`product_type`,
- jc.`parent_id`,
- jc.`product_name`,
- jc.`alias`,
- jc.`company`,
- jc.`product_code`,
- jc.`connection_method`,
- jc.`premium_setting`,
- jc.`coverage` AS jsCoverage,
- jc.`premium` AS jsPremium,
- jc.`system_code`,
- jc.`is_delete` AS isDelete,
- jb.id AS blame_id,
- jb.blame,
- jb.blame_code,
- jb.blame_coverage,
- jb.blame_premium,
- jb.system_code AS blame_system_code,
- jb.jyx_config_id AS blame_jyx_config_id,
- js.id AS setting_id,
- js.seats,
- js.coverage AS setting_coverage,
- js.premium AS setting_premium,
- js.system_code AS setting_system_code,
- js.jyx_config_id AS setting_jyx_config_id
- from jyx_config jc
- left join jyx_blame jb on jc.id = jb.jyx_config_id AND jb.is_delete = 0
- left join jyx_setting js on jc.id = js.jyx_config_id AND js.is_delete = 0
- <where>
- jc.is_delete = 0 and jc.parent_id = 0
- <if test="company != null and company != ''">
- and jc.company = #{company}
- </if>
- </where>
- order by jc.create_time desc
- </select>
- </mapper>
|