| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- <?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.unis.cbl.server.dao.irpt.RotateProgressDao">
-
- <resultMap id="tableHeadMap" type="java.util.Map">
- <result property="dictCode" column="dict_code"/>
- <result property="dictName" column="dict_name"/>
- <result property="orderBy" column="order_by"/>
- </resultMap>
-
- <select id="listTableHead" resultMap="tableHeadMap">
- select parent_dict.dict_code,
- parent_dict.order_by,
- parent_dict.dict_name
- from ty_jhhz t1
- inner join usercenter.sys_dictionary dict on dict.dict_code = t1.lcpzbm and dict.group_id = 'PM001'
- left join usercenter.sys_dictionary parent_dict on parent_dict.dict_code = dict.pdict_code and parent_dict.group_id = 'PM001'
- where t1.jhnd = #{currentYear} and t1.ph_status = '1'
- group by parent_dict.dict_code, parent_dict.dict_name, parent_dict.order_by
- </select>
-
- <resultMap id="tableBodyDataMap" type="com.unis.cbl.common.entity.RotateProgressDetail">
- <result property="name" column="name"/>
- <result property="code" column="code"/>
- <result property="businessType" column="business_type"/>
- <result property="dictCode" column="dict_code"/>
- <result property="amount" column="amount"/>
- <result property="orderBy" column="order_by"/>
- </resultMap>
-
- <select id="listTableBodyData" resultMap="tableBodyDataMap">
- select
- sskddm code, t5.qymc name, ywlx business_type,
- t3.order_by,
- dict_code, cast(amount as decimal(17,3)) amount
- from (
- select
- sskddm, ywlx,
- dict_code, if(phhds is not null, phhds, lcds) amount
- from (
- select
- case when t1.sskddm = '911202245661145255001' then '91120224712876078R001'
- else t1.sskddm
- end as sskddm, t1.ywlx,
- parent_dict.dict_code,
- sum(t1.lcds) as lcds, sum(t1.phhds) as phhds
- from ty_jhhz t1
- inner join usercenter.sys_dictionary dict on dict.dict_code = t1.lcpzbm and dict.group_id = 'PM001'
- left join usercenter.sys_dictionary parent_dict on parent_dict.dict_code = dict.pdict_code and dict.group_id = 'PM001'
- where t1.jhnd = #{currentYear, jdbcType=VARCHAR} and t1.lcds is not null and t1.ph_status = '1'
- group by t1.ywlx, parent_dict.dict_code, parent_dict.dict_name, t1.sskddm
- )
- union all
- select
- sskddm, 41 as ywlx,
- parent_dict.dict_code,
- cast(sum(ifnull(lsyqsl, 0)) as decimal(17,3)) amount
- from db_utf8.ty_lhtzd t1
- inner join usercenter.sys_dictionary dict on dict.dict_name = t1.pzmc and dict.group_id = 'PM001'
- left join usercenter.sys_dictionary parent_dict on parent_dict.dict_code = dict.pdict_code and parent_dict.group_id = 'PM001'
- where DATE_FORMAT(ckqx, '%Y-%m') = #{month, jdbcType=VARCHAR} and zt = '91000004' and status = 1 and tzdlx = '01' and ywlx= '4'
- group by ywlx, tzdlx,parent_dict.dict_code, parent_dict.dict_name, sskddm
- union all
- select
- sskd, 21 as ywlx,
- parent_dict.dict_code,
- cast(sum(ifnull(rksl, 0)) as decimal(17,3)) amount
- from db_utf8.ty_crkyszb t1
- inner join usercenter.sys_dictionary dict on dict.dict_code = t1.lspzbm and dict.group_id = 'PM001'
- left join usercenter.sys_dictionary parent_dict on parent_dict.dict_code = dict.pdict_code and dict.group_id = 'PM001'
- where DATE_FORMAT(zgjlspsj, '%Y-%m') = #{month, jdbcType=VARCHAR} and status = 1 and shzt = '91000900' and yslx = '1'
- group by yslx,parent_dict.dict_code, sskd
- ) t2
- left join base.d_kdxxsjy t4 on t4.kddm = t2.sskddm
- left join base.tz_slqy t5 on t5.tyshxydm = t4.tyshxydm
- left join usercenter.sys_orgainze t3 on t3.org_code = t5.qyjgdm
- order by t3.order_by
- </select>
- </mapper>
|