| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488 |
- <?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.ydtech.modules.report.dao.ReportInsurancePolicyMapper">
- <resultMap id="BaseResultMap" type="com.ydtech.modules.report.model.ReportInsurancePolicy">
- <result property="companyId" column="company_id" jdbcType="VARCHAR"/>
- <result property="insCompany" column="ins_company" jdbcType="VARCHAR"/>
- <result property="agreementId" column="agreement_id" jdbcType="VARCHAR"/>
- <result property="agreementName" column="agreement_name" jdbcType="VARCHAR"/>
- <result property="policyno" column="policyno" jdbcType="VARCHAR"/>
- <result property="insidePayTime" column="inside_pay_time" jdbcType="TIMESTAMP"/>
- <result property="startDate" column="start_date" jdbcType="VARCHAR"/>
- <result property="endDate" column="end_date" jdbcType="VARCHAR"/>
- <result property="riskCode" column="risk_code" jdbcType="VARCHAR"/>
- <result property="riskName" column="risk_name" jdbcType="VARCHAR"/>
- <result property="sumpremium" column="sumpremium" jdbcType="DECIMAL"/>
- <result property="taxpremium" column="taxpremium" jdbcType="DECIMAL"/>
- <result property="taxLaterPremium" column="tax_later_premium" jdbcType="DECIMAL"/>
- <result property="insuranceSubAmount" column="insurance_sub_amount" jdbcType="VARCHAR"/>
- <result property="frameno" column="frameno" jdbcType="VARCHAR"/>
- <result property="licenseno" column="licenseno" jdbcType="VARCHAR"/>
- <result property="vehicleUse" column="vehicle_use" jdbcType="VARCHAR"/>
- <result property="powerType" column="power_type" jdbcType="VARCHAR"/>
- <result property="cimodelclass" column="cimodelclass" jdbcType="VARCHAR"/>
- <result property="limitLoad" column="limit_load" jdbcType="VARCHAR"/>
- <result property="appliName" column="appli_name" jdbcType="VARCHAR"/>
- <result property="insureName" column="insure_name" jdbcType="VARCHAR"/>
- <result property="deptid" column="deptid" jdbcType="VARCHAR"/>
- <result property="deptname" column="deptname" jdbcType="VARCHAR"/>
- <result property="userid" column="userid" jdbcType="VARCHAR"/>
- <result property="username" column="username" jdbcType="VARCHAR"/>
- <result property="productid" column="productid" jdbcType="VARCHAR"/>
- <result property="product" column="product" jdbcType="VARCHAR"/>
- <result property="operatorid" column="operatorid" jdbcType="VARCHAR"/>
- <result property="sumCostsPremiums" column="sum_costs_premiums" jdbcType="DECIMAL"/>
- <result property="superviseCostsPremiums" column="supervise_costs_premiums" jdbcType="DECIMAL"/>
- <result property="otherCostsPremiums" column="other_costs_premiums" jdbcType="DECIMAL"/>
- <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
- </resultMap>
- <select id="queryOrderAndCostData" resultMap="OrderAndCostDataMap">
- SELECT
- <!--下钻查询时拼接-->
- <if test="reportReqVo.isDrilling != null and reportReqVo.isDrilling == '1'.toString()">
- <!--按团队下钻时-->
- <if test="reportReqVo.drilType != null and reportReqVo.drilType == '1'.toString()">
- p.`username`,p.userid userId,
- </if>
- <!--按机构下钻时-->
- <if test="reportReqVo.drilType != null and reportReqVo.drilType == '0'.toString()">
- <choose>
- <!--下钻的是五级机构时,下钻到团队-->
- <when test="reportReqVo.drilFlag != null and reportReqVo.drilFlag == '0'.toString()">
- p.deptid,
- </when>
- <!--下钻的非五级机构时,下钻到下级机构-->
- <otherwise>
- substr(p.deptid,1,#{reportReqVo.drilFlag}) institutionId,
- </otherwise>
- </choose>
- </if>
- <!--团队返回上层时-->
- <if test="reportReqVo.drilType != null and reportReqVo.drilType == '2'.toString()">
- p.deptid,
- </if>
- <!--机构返回上层时-->
- <if test="reportReqVo.drilType != null and reportReqVo.drilType == '3'.toString()">
- substr(p.deptid,1,#{reportReqVo.drilFlag}) institutionId,
- </if>
- </if>
- <if test="reportReqVo.riskCode != null and reportReqVo.riskCode != ''">
- <if test="reportReqVo.riskCode!='ALL'.toString()">
- p.`risk_name` risk_name,
- </if>
- </if>
- count(distinct policyno) policy_count,
- SUM(p.`sumpremium`) sumpremium,
- SUM(p.`supervise_costs_premiums`) supervise_costs_premiums,
- SUM(p.`other_costs_premiums`) other_costs_premiums,
- SUM(p.`sum_costs_premiums`) sum_costs_premiums
- FROM
- report_insurance_policy p WHERE 1=1
- <!--下钻查询时拼接-->
- <if test="reportReqVo.isDrilling != null and reportReqVo.isDrilling == '1'.toString()">
- <!--按团队下钻时-->
- <if test="reportReqVo.drilType != null and reportReqVo.drilType == '1'.toString()">
- <if test="reportReqVo.teamCode != null and reportReqVo.teamCode != ''">
- and p.deptid = #{reportReqVo.teamCode}
- </if>
- </if>
- <!--按机构下钻时-->
- <if test="reportReqVo.drilType != null and reportReqVo.drilType == '0'.toString()">
- <choose>
- <!--下钻的是五级机构时,下钻到团队-->
- <when test="reportReqVo.drilFlag != null and reportReqVo.drilFlag == '0'.toString()">
- and p.deptid in (SELECT id FROM `sys_dept` WHERE parent_id= #{reportReqVo.deptId} )
- </when>
- <!--下钻的非五级机构时,下钻到下级机构-->
- <otherwise>
- and substr(p.deptid,1,#{reportReqVo.drilFlag}) in (SELECT id FROM `sys_dept` WHERE parent_id= #{reportReqVo.deptId} )
- </otherwise>
- </choose>
- </if>
- <!--团队返回上层时-->
- <if test="reportReqVo.drilType != null and reportReqVo.drilType == '2'.toString()">
- and p.deptid = #{reportReqVo.deptId}
- </if>
- <!--机构返回上层时-->
- <if test="reportReqVo.drilType != null and reportReqVo.drilType == '3'.toString()">
- and substr(p.deptid,1,#{reportReqVo.drilFlag}) = #{reportReqVo.deptId}
- </if>
- </if>
- <!--非下钻查询时拼接-->
- <if test="reportReqVo.isDrilling != null and reportReqVo.isDrilling == '0'.toString()">
- <choose>
- <!--条件中团队不为空时,直接拼接团队-->
- <when test="reportReqVo.teamCode != null and reportReqVo.teamCode != ''">
- and p.deptid = #{reportReqVo.teamCode}
- </when>
- <!--条件中团队为空时,使用机构模糊查询-->
- <otherwise>
- <if test="reportReqVo.deptId != null and reportReqVo.deptId != ''">
- and p.deptid like #{reportReqVo.deptId}"%"
- </if>
- </otherwise>
- </choose>
- <if test="reportReqVo.userId != null and reportReqVo.userId != ''">
- and p.userid = #{reportReqVo.userId}
- </if>
- </if>
- <!--通用查询条件拼接-->
- <if test="reportReqVo.insCompany != null and reportReqVo.insCompany != ''">
- and p.company_id = #{reportReqVo.insCompany}
- </if>
- <if test="reportReqVo.riskCode != null and reportReqVo.riskCode != ''">
- <if test="reportReqVo.riskCode!='ALL'.toString()">
- and p.risk_code = #{reportReqVo.riskCode}
- </if>
- </if>
- <if test="reportReqVo.quoteStartDate != null and reportReqVo.quoteEndDate != null">
- and p.inside_pay_time between #{reportReqVo.quoteStartDate} AND #{reportReqVo.quoteEndDate}
- </if>
- <choose>
- <when test="reportReqVo.riskCode != null and reportReqVo.riskCode!='ALL'.toString()">
- GROUP BY p.`risk_name`
- <!--下钻查询时拼接-->
- <if test="reportReqVo.isDrilling != null and reportReqVo.isDrilling == '1'.toString()">
- <!--按团队下钻时-->
- <if test="reportReqVo.drilType != null and reportReqVo.drilType == '1'.toString()">
- ,p.`username`,p.userid order by p.`username`,p.`risk_name`
- </if>
- <!--按机构下钻时-->
- <if test="reportReqVo.drilType != null and reportReqVo.drilType == '0'.toString()">
- <choose>
- <!--下钻的是五级机构时,下钻到团队-->
- <when test="reportReqVo.drilFlag != null and reportReqVo.drilFlag == '0'.toString()">
- ,p.deptid order by p.deptid,p.`risk_name`
- </when>
- <!--下钻的非五级机构时,下钻到下级机构-->
- <otherwise>
- ,substr(p.deptid,1,#{reportReqVo.drilFlag}) order by substr(p.deptid,1,#{reportReqVo.drilFlag}),p.`risk_name`
- </otherwise>
- </choose>
- </if>
- <!--团队返回上层时-->
- <if test="reportReqVo.drilType != null and reportReqVo.drilType == '2'.toString()">
- ,p.deptid order by p.deptid
- </if>
- <!--机构返回上层时-->
- <if test="reportReqVo.drilType != null and reportReqVo.drilType == '3'.toString()">
- ,substr(p.deptid,1,#{reportReqVo.drilFlag}) order by substr(p.deptid,1,#{reportReqVo.drilFlag})
- </if>
- </if>
- </when>
- <otherwise>
- <!--下钻查询时拼接-->
- <if test="reportReqVo.isDrilling != null and reportReqVo.isDrilling == '1'.toString()">
- <!--按团队下钻时-->
- <if test="reportReqVo.drilType != null and reportReqVo.drilType == '1'.toString()">
- group by p.`username`,p.userid order by p.`username`
- </if>
- <!--按机构下钻时-->
- <if test="reportReqVo.drilType != null and reportReqVo.drilType == '0'.toString()">
- <choose>
- <!--下钻的是五级机构时,下钻到团队-->
- <when test="reportReqVo.drilFlag != null and reportReqVo.drilFlag == '0'.toString()">
- group by p.deptid order by p.deptid
- </when>
- <!--下钻的非五级机构时,下钻到下级机构-->
- <otherwise>
- group by substr(p.deptid,1,#{reportReqVo.drilFlag}) order by substr(p.deptid,1,#{reportReqVo.drilFlag})
- </otherwise>
- </choose>
- </if>
- <!--团队返回上层时-->
- <if test="reportReqVo.drilType != null and reportReqVo.drilType == '2'.toString()">
- group by p.deptid order by p.deptid
- </if>
- <!--机构返回上层时-->
- <if test="reportReqVo.drilType != null and reportReqVo.drilType == '3'.toString()">
- group by substr(p.deptid,1,#{reportReqVo.drilFlag}) order by substr(p.deptid,1,#{reportReqVo.drilFlag})
- </if>
- </if>
- </otherwise>
- </choose>
- </select>
- <resultMap id="OrderAndCostDataMap" type="com.ydtech.modules.report.model.vo.OrderVolumeAndCostStatisticsResVo">
- <result property="institution" column="institution" jdbcType="VARCHAR"/>
- <result property="deptname" column="deptname" jdbcType="VARCHAR"/>
- <result property="username" column="username" jdbcType="VARCHAR"/>
- <result property="riskName" column="risk_name" jdbcType="VARCHAR"/>
- <result property="policyCount" column="policy_count" jdbcType="DECIMAL"/>
- <result property="sumPremium" column="sumremium" jdbcType="DECIMAL"/>
- <result property="sumCostsPremiums" column="sum_costs_premiums" jdbcType="DECIMAL"/>
- <result property="superviseCostsPremiums" column="supervise_costs_premiums" jdbcType="DECIMAL"/>
- <result property="otherCostsPremiums" column="other_costs_premiums" jdbcType="DECIMAL"/>
- </resultMap>
- <select id="queryOrderAndCostDataCount" resultType="Long">
- select
- count(1)
- from (
- SELECT
- <!--下钻查询时拼接-->
- <if test="reportReqVo.isDrilling != null and reportReqVo.isDrilling == '1'.toString()">
- <!--按团队下钻时-->
- <if test="reportReqVo.drilType != null and reportReqVo.drilType == '1'.toString()">
- p.`username`,p.userid userId,
- </if>
- <!--按机构下钻时-->
- <if test="reportReqVo.drilType != null and reportReqVo.drilType == '0'.toString()">
- <choose>
- <!--下钻的是五级机构时,下钻到团队-->
- <when test="reportReqVo.drilFlag != null and reportReqVo.drilFlag == '0'.toString()">
- p.deptid,
- </when>
- <!--下钻的非五级机构时,下钻到下级机构-->
- <otherwise>
- substr(p.deptid,1,#{reportReqVo.drilFlag}) institutionId,
- </otherwise>
- </choose>
- </if>
- <!--团队返回上层时-->
- <if test="reportReqVo.drilType != null and reportReqVo.drilType == '2'.toString()">
- p.deptid,
- </if>
- <!--机构返回上层时-->
- <if test="reportReqVo.drilType != null and reportReqVo.drilType == '3'.toString()">
- substr(p.deptid,1,#{reportReqVo.drilFlag}) institutionId,
- </if>
- </if>
- <if test="reportReqVo.riskCode != null and reportReqVo.riskCode != ''">
- <if test="reportReqVo.riskCode!='ALL'.toString()">
- p.`risk_name` risk_name,
- </if>
- </if>
- count(distinct policyno) policy_count,
- SUM(p.`sumpremium`) sumpremium,
- SUM(p.`supervise_costs_premiums`) supervise_costs_premiums,
- SUM(p.`other_costs_premiums`) other_costs_premiums,
- SUM(p.`sum_costs_premiums`) sum_costs_premiums
- FROM
- report_insurance_policy p WHERE 1=1
- <!--下钻查询时拼接-->
- <if test="reportReqVo.isDrilling != null and reportReqVo.isDrilling == '1'.toString()">
- <!--按团队下钻时-->
- <if test="reportReqVo.drilType != null and reportReqVo.drilType == '1'.toString()">
- <if test="reportReqVo.teamCode != null and reportReqVo.teamCode != ''">
- and p.deptid = #{reportReqVo.teamCode}
- </if>
- </if>
- <!--按机构下钻时-->
- <if test="reportReqVo.drilType != null and reportReqVo.drilType == '0'.toString()">
- <choose>
- <!--下钻的是五级机构时,下钻到团队-->
- <when test="reportReqVo.drilFlag != null and reportReqVo.drilFlag == '0'.toString()">
- and p.deptid in (SELECT id FROM `sys_dept` WHERE parent_id= #{reportReqVo.deptId} )
- </when>
- <!--下钻的非五级机构时,下钻到下级机构-->
- <otherwise>
- and substr(p.deptid,1,#{reportReqVo.drilFlag}) in (SELECT id FROM `sys_dept` WHERE parent_id= #{reportReqVo.deptId} )
- </otherwise>
- </choose>
- </if>
- <!--团队返回上层时-->
- <if test="reportReqVo.drilType != null and reportReqVo.drilType == '2'.toString()">
- and p.deptid = #{reportReqVo.deptId}
- </if>
- <!--机构返回上层时-->
- <if test="reportReqVo.drilType != null and reportReqVo.drilType == '3'.toString()">
- and substr(p.deptid,1,#{reportReqVo.drilFlag}) = #{reportReqVo.deptId}
- </if>
- </if>
- <!--非下钻查询时拼接-->
- <if test="reportReqVo.isDrilling != null and reportReqVo.isDrilling == '0'.toString()">
- <choose>
- <!--条件中团队不为空时,直接拼接团队-->
- <when test="reportReqVo.teamCode != null and reportReqVo.teamCode != ''">
- and p.deptid = #{reportReqVo.teamCode}
- </when>
- <!--条件中团队为空时,使用机构模糊查询-->
- <otherwise>
- <if test="reportReqVo.deptId != null and reportReqVo.deptId != ''">
- and p.deptid like #{reportReqVo.deptId}"%"
- </if>
- </otherwise>
- </choose>
- <if test="reportReqVo.userId != null and reportReqVo.userId != ''">
- and p.userid = #{reportReqVo.userId}
- </if>
- </if>
- <!--通用查询条件拼接-->
- <if test="reportReqVo.insCompany != null and reportReqVo.insCompany != ''">
- and p.company_id = #{reportReqVo.insCompany}
- </if>
- <if test="reportReqVo.riskCode != null and reportReqVo.riskCode != ''">
- <if test="reportReqVo.riskCode!='ALL'.toString()">
- and p.risk_code = #{reportReqVo.riskCode}
- </if>
- </if>
- <if test="reportReqVo.quoteStartDate != null and reportReqVo.quoteEndDate != null">
- and p.inside_pay_time between #{reportReqVo.quoteStartDate} AND #{reportReqVo.quoteEndDate}
- </if>
- <choose>
- <when test="reportReqVo.riskCode != null and reportReqVo.riskCode!='ALL'.toString()">
- GROUP BY p.`risk_name`
- <!--下钻查询时拼接-->
- <if test="reportReqVo.isDrilling != null and reportReqVo.isDrilling == '1'.toString()">
- <!--按团队下钻时-->
- <if test="reportReqVo.drilType != null and reportReqVo.drilType == '1'.toString()">
- ,p.`username`,p.userid order by p.`username`,p.`risk_name`
- </if>
- <!--按机构下钻时-->
- <if test="reportReqVo.drilType != null and reportReqVo.drilType == '0'.toString()">
- <choose>
- <!--下钻的是五级机构时,下钻到团队-->
- <when test="reportReqVo.drilFlag != null and reportReqVo.drilFlag == '0'.toString()">
- ,p.deptid order by p.deptid,p.`risk_name`
- </when>
- <!--下钻的非五级机构时,下钻到下级机构-->
- <otherwise>
- ,substr(p.deptid,1,#{reportReqVo.drilFlag}) order by substr(p.deptid,1,#{reportReqVo.drilFlag}),p.`risk_name`
- </otherwise>
- </choose>
- </if>
- <!--团队返回上层时-->
- <if test="reportReqVo.drilType != null and reportReqVo.drilType == '2'.toString()">
- ,p.deptid order by p.deptid
- </if>
- <!--机构返回上层时-->
- <if test="reportReqVo.drilType != null and reportReqVo.drilType == '3'.toString()">
- ,substr(p.deptid,1,#{reportReqVo.drilFlag}) order by substr(p.deptid,1,#{reportReqVo.drilFlag})
- </if>
- </if>
- </when>
- <otherwise>
- <!--下钻查询时拼接-->
- <if test="reportReqVo.isDrilling != null and reportReqVo.isDrilling == '1'.toString()">
- <!--按团队下钻时-->
- <if test="reportReqVo.drilType != null and reportReqVo.drilType == '1'.toString()">
- group by p.`username`,p.userid order by p.`username`
- </if>
- <!--按机构下钻时-->
- <if test="reportReqVo.drilType != null and reportReqVo.drilType == '0'.toString()">
- <choose>
- <!--下钻的是五级机构时,下钻到团队-->
- <when test="reportReqVo.drilFlag != null and reportReqVo.drilFlag == '0'.toString()">
- group by p.deptid order by p.deptid
- </when>
- <!--下钻的非五级机构时,下钻到下级机构-->
- <otherwise>
- group by substr(p.deptid,1,#{reportReqVo.drilFlag}) order by substr(p.deptid,1,#{reportReqVo.drilFlag})
- </otherwise>
- </choose>
- </if>
- <!--团队返回上层时-->
- <if test="reportReqVo.drilType != null and reportReqVo.drilType == '2'.toString()">
- group by p.deptid order by p.deptid
- </if>
- <!--机构返回上层时-->
- <if test="reportReqVo.drilType != null and reportReqVo.drilType == '3'.toString()">
- group by substr(p.deptid,1,#{reportReqVo.drilFlag}) order by substr(p.deptid,1,#{reportReqVo.drilFlag})
- </if>
- </if>
- </otherwise>
- </choose>
- ) as s
- </select>
- <resultMap id="OrderVolumeAndCostStatisticsListResMap" type="com.ydtech.modules.report.model.vo.OrderVolumeAndCostStatisticsListResVo">
- <result property="insCompany" column="ins_company" jdbcType="VARCHAR"/>
- <result property="agreementName" column="agreement_name" jdbcType="VARCHAR"/>
- <result property="policyno" column="policyno" jdbcType="VARCHAR"/>
- <result property="insidePayTime" column="inside_pay_time" jdbcType="VARCHAR"/>
- <result property="startDate" column="start_date" jdbcType="VARCHAR"/>
- <result property="endDate" column="end_date" jdbcType="VARCHAR"/>
- <result property="riskName" column="risk_name" jdbcType="VARCHAR"/>
- <result property="sumpremium" column="sumpremium" jdbcType="DECIMAL"/>
- <result property="taxpremium" column="taxpremium" jdbcType="DECIMAL"/>
- <result property="taxLaterPremium" column="tax_later_premium" jdbcType="DECIMAL"/>
- <result property="insuranceSubAmount" column="insurance_sub_amount" jdbcType="VARCHAR"/>
- <result property="frameno" column="frameno" jdbcType="VARCHAR"/>
- <result property="licenseno" column="licenseno" jdbcType="VARCHAR"/>
- <result property="vehicleUse" column="vehicle_use" jdbcType="VARCHAR"/>
- <result property="powerType" column="power_type" jdbcType="VARCHAR"/>
- <result property="cimodelclass" column="cimodelclass" jdbcType="VARCHAR"/>
- <result property="limitLoad" column="limit_load" jdbcType="VARCHAR"/>
- <result property="appliName" column="appli_name" jdbcType="VARCHAR"/>
- <result property="insureName" column="insure_name" jdbcType="VARCHAR"/>
- <result property="deptname" column="deptname" jdbcType="VARCHAR"/>
- <result property="username" column="username" jdbcType="VARCHAR"/>
- <result property="product" column="product" jdbcType="VARCHAR"/>
- <result property="sumCostsPremiums" column="sum_costs_premiums" jdbcType="DECIMAL"/>
- <result property="superviseCostsPremiums" column="supervise_costs_premiums" jdbcType="DECIMAL"/>
- <result property="otherCostsPremiums" column="other_costs_premiums" jdbcType="DECIMAL"/>
- </resultMap>
- <select id="queryOrderAndCostList" resultMap="OrderVolumeAndCostStatisticsListResMap">
- SELECT
- ins_company,
- agreement_name,
- policyno,
- DATE_FORMAT(inside_pay_time, '%Y-%m-%d') inside_pay_time,
- DATE_FORMAT(start_date, '%Y-%m-%d') start_date,
- DATE_FORMAT(end_date, '%Y-%m-%d') end_date,
- risk_name,
- sumpremium,
- taxpremium,
- tax_later_premium,
- insurance_sub_amount,
- frameno,
- licenseno,
- vehicle_use,
- power_type,
- cimodelclass,
- limit_load,
- appli_name,
- insure_name,
- deptname,
- username,
- product,
- sum_costs_premiums,
- supervise_costs_premiums,
- other_costs_premiums
- FROM
- report_insurance_policy p WHERE 1=1
- <choose>
- <!--条件中团队不为空时,直接拼接团队-->
- <when test="reportReqVo.teamCode != null and reportReqVo.teamCode != ''">
- and p.deptid = #{reportReqVo.teamCode}
- </when>
- <!--条件中团队为空时,使用机构模糊查询-->
- <otherwise>
- <if test="reportReqVo.deptId != null and reportReqVo.deptId != ''">
- and p.deptid like #{reportReqVo.deptId}"%"
- </if>
- </otherwise>
- </choose>
- <if test="reportReqVo.userId != null and reportReqVo.userId != ''">
- and p.userid = #{reportReqVo.userId}
- </if>
- <!--通用查询条件拼接-->
- <if test="reportReqVo.insCompany != null and reportReqVo.insCompany != ''">
- and p.company_id = #{reportReqVo.insCompany}
- </if>
- <if test="reportReqVo.riskCode != null and reportReqVo.riskCode != ''">
- <if test="reportReqVo.riskCode!='ALL'.toString()">
- and p.risk_code = #{reportReqVo.riskCode}
- </if>
- </if>
- <if test="reportReqVo.quoteStartDate != null and reportReqVo.quoteEndDate != null">
- and p.inside_pay_time between #{reportReqVo.quoteStartDate} AND #{reportReqVo.quoteEndDate}
- </if>
- </select>
- </mapper>
|