Commit 37cf3575 authored by suhuiguang's avatar suhuiguang

1.特种设备模块拆分

parent 31378855
package com.yeejoin.amos.boot.module.flc.api.dto;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 配套设备/设施/部件
*
* @author system_generator
* @date 2021-11-26
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value="EquipmentAssociatedDto", description="配套设备/设施/部件")
public class EquipmentAssociatedDto extends BaseDto {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "设备id")
private Long equipmentId;
@ApiModelProperty(value = "名称")
private String name;
@ApiModelProperty(value = "型号")
private String model;
@ApiModelProperty(value = "规格")
private String specifications;
@ApiModelProperty(value = "编号")
private String code;
@ApiModelProperty(value = "数量")
private Integer amount;
@ApiModelProperty(value = "制造单位")
private String manufacturer;
@ApiModelProperty(value = "制造日期")
private Date productionDate;
@ApiModelProperty(value = "部件/装置号")
private String partNumber;
@ApiModelProperty(value = "型式试验合格证号")
private String certificateNumber;
@ApiModelProperty(value = "备注")
private String remark;
@ApiModelProperty(value = "鉴定机构名称")
private String appraisalAgencyName;
@ApiModelProperty(value = "设计文件鉴定日期")
private Date appraisalDate;
@ApiModelProperty(value = "鉴定报告书编号")
private String appraisalReportNumber;
@ApiModelProperty(value = "监检检验机构")
private String supervisoryInspectionAgency;
@ApiModelProperty(value = "统一社会信用代码")
private String socialCreditCode;
@ApiModelProperty(value = "机构核准证编号")
private String approvalCertificateNumber;
@ApiModelProperty(value = "更新人id")
private Long recUserD;
}
<?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.yeejoin.amos.boot.module.flc.api.mapper.CylinderAreaDataMapper">
</mapper>
<?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.yeejoin.amos.boot.module.flc.api.mapper.CylinderDateInfoMapper">
</mapper>
<?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.yeejoin.amos.boot.module.flc.api.mapper.CylinderFillingCheckDataUnitMapper">
</mapper>
<?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.yeejoin.amos.boot.module.flc.api.mapper.CylinderFillingCheckMapper">
<select id="queryIntegirtyByAppId" resultType="java.lang.Double">
SELECT AVG(integrity) AS score_avg FROM tz_cylinder_filling_check t where t.app_id = #{appId} AND
DATE_SUB(CURDATE(), INTERVAL 30 DAY) <![CDATA[ <= ]]> date_format(t.sync_date,'%Y-%M-%d');
</select>
<select id="getFillingCountByMonth" resultType="java.lang.Integer">
select count(1) from tz_cylinder_filling_check r where date_format(r.inspection_date,'%Y-%m') = date_format(#{time},'%Y-%m') and app_id = #{appId}
</select>
<select id="getFillingPassedCountByMonth" resultType="java.lang.Integer">
select
IFNULL(
sum(
case c.within_scope+c.sealed_state+c.defective+c.abnormal_temperature+c.warning_sign
when 15730 then 1
else
0 end ), 0) from tz_cylinder_filling_check c where date_format(c.inspection_date,'%Y-%m') = date_format(#{time},'%Y-%m') and app_id = #{appId}
</select>
</mapper>
<?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.yeejoin.amos.boot.module.flc.api.mapper.CylinderFillingDataUnitMapper">
</mapper>
<?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.yeejoin.amos.boot.module.flc.api.mapper.CylinderFillingExamineMapper">
</mapper>
<?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.yeejoin.amos.boot.module.flc.api.mapper.CylinderFillingMapper">
<select id="queryIntegirtyByAppId" resultType="java.lang.Double">
SELECT AVG(integrity) AS score_avg FROM tz_cylinder_filling t where t.app_id = #{appId} AND
DATE_SUB(CURDATE(), INTERVAL 30 DAY) <![CDATA[ <= ]]> date_format(T.sync_date,'yyyy-mm-dd');
</select>
<select id="getFillingCountByMonth" resultType="java.lang.Integer">
select count(1) from tz_cylinder_filling r where date_format(r.inspection_date,'%Y-%m') = date_format(#{time},'%Y-%m') and app_id = #{appId}
</select>
<select id="getFillingPassedCountByMonth" resultType="java.lang.Integer">
select
IFNULL(
sum(
case f.is_valid+f.same+f.is_regulations+f.is_compliance_withGBT+f.have_still_pressure+f.is_complete+f.have_security_documents
when 21920 then 1
else
0 end ),0) from tz_cylinder_filling f where date_format(f.inspection_date,'%Y-%m') = date_format(#{time},'%Y-%m') and app_id = #{appId}
</select>
</mapper>
<?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.yeejoin.amos.boot.module.flc.api.mapper.CylinderFillingRecordMapper">
<select id="queryIntegirtyByAppId" resultType="java.lang.Double">
SELECT AVG(integrity) AS score_avg FROM tz_cylinder_filling_record t where t.app_id = #{appId} AND
DATE_SUB(CURDATE(), INTERVAL 30 DAY) <![CDATA[ <= ]]> t.sync_date;
</select>
<select id="getFillingSum" resultType="java.lang.Double">
select ifnull(sum(r.filling_quantity),0) from tz_cylinder_filling_record r where date_format(r.filling_endTime,'%Y-%m-%d') = date_format(#{time},'%Y-%m-%d') and app_id in (
select u.app_id from tz_cylinder_unit u where u.region_code like CONCAT('%',#{regionCode},'%')
)
</select>
<select id="queryListByQueryDto" resultType="java.util.Map">
SELECT
r.sequence_nbr AS sequenceNbr,
-- r.filling_unit_name AS fillingUnitName,
-- r.factory_num AS factoryNum,
-- CASE
-- i.cylinder_variety
-- WHEN 1 THEN
-- '无缝气瓶'
-- WHEN 2 THEN
-- '焊接气瓶'
-- WHEN 3 THEN
-- '缠绕气瓶'
-- WHEN 4 THEN
-- '绝热气瓶'
-- WHEN 5 THEN
-- '内装填料气瓶'
-- ELSE
-- ''
-- END AS cylinderVariety,
-- i.qrCode AS qrCode,
-- i.electronic_label_code AS electronicLabelCode,
-- r.sequence_code AS sequenceCode,
-- i.unit_inner_code AS unitInnerCode,
-- u.unit_name AS propertyUnit,
r.filling_startTime AS fillingStarttime,
r.filling_endTime AS fillingEndtime,
r.filling_user AS fillingUser,
r.filling_quantity AS fillingQuantity,
r.temperature AS temperature,
case r.abnormal
WHEN 0 THEN
'有异常'
WHEN 1 THEN
'正常'
ELSE
''
END AS abnormalStr,
b.inspection_date as inspectionDate,
b.inspector_user as inspector_user,
b.is_valid,
b.same,
b.is_regulations,
b.is_complete,
b.have_still_pressure,
b.is_complete,
b.have_security_documents,
(b.is_valid+b.same+b.is_regulations+b.is_complete+b.have_still_pressure+b.is_complete+b.have_security_documents) as count,
case b.is_valid+b.same+b.is_regulations+b.is_complete+b.have_still_pressure+b.is_complete+b.have_security_documents
when 7 then '合格'
else
'不合格'
end as fillingResult,
af.inspector as inspector,
af.inspection_date as inspectionDateAfter,
af.within_scope,
af.sealed_state,
af.defective,
af.abnormal_temperature,
af.warning_sign,
case af.within_scope+af.sealed_state+af.defective+af.abnormal_temperature+af.warning_sign
when 5 then '合格'
else
'不合格'
end as checkResult
FROM
tz_cylinder_filling_record r
left join tz_cylinder_unit u on u.app_id = r.app_id
left join tz_cylinder_filling b on b.filling_before_id = r.filling_before_id AND
date_format(b.inspection_date,'%Y-%m-%d') = date_format(r.filling_startTime,'%Y-%m-%d')
left join tz_cylinder_filling_check af on af.filling_check_id = r.filling_check_id AND
date_format(af.inspection_date,'%Y-%m-%d') = date_format(r.filling_startTime,'%Y-%m-%d')
left join tz_cylinder_info i on b.sequence_code = i.sequence_code
WHERE
1= 1
<if test="appId != null and appId != ''">
AND r.app_id = #{appId}
</if>
<!-- <if test="fillingUnitName != null and fillingUnitName != ''">-->
<!-- AND r.filling_unit_name like-->
<!-- CONCAT(CONCAT('%',#{fillingUnitName}),'%')-->
<!-- </if>-->
<!-- <if test="propertyUnit != null and propertyUnit != ''">-->
<!-- AND u.unit_name like-->
<!-- CONCAT(CONCAT('%',#{propertyUnit}),'%')-->
<!-- </if>-->
<!-- <if test="factoryNum != null and factoryNum != ''">-->
<!-- AND r.factory_num like-->
<!-- CONCAT(CONCAT('%',#{factoryNum}),'%')-->
<!-- </if>-->
<if test="fillingStartTime != null ">
and #{fillingStartTime} <![CDATA[ <= ]]>
r.filling_startTime
</if>
<if test="fillingEndTime != null ">
and r.filling_endTime <![CDATA[ <= ]]>
#{fillingEndTime}
</if>
<!-- <if test="cylinderVariety != null and cylinderVariety != ''">-->
<!-- AND i.cylinder_variety = #{cylinderVariety}-->
<!-- </if>-->
<!-- <if test="qrCode != null and qrCode != ''">-->
<!-- AND i.qrCode like CONCAT(CONCAT('%',#{qrCode}),'%')-->
<!-- </if>-->
<!-- <if test="electronicLabelCode != null and electronicLabelCode != ''">-->
<!-- AND i.electronic_label_code like-->
<!-- CONCAT(CONCAT('%',#{electronicLabelCode}),'%')-->
<!-- </if>-->
<!-- <if test="sequenceCode != null and sequenceCode != ''">-->
<!-- AND r.sequence_code like-->
<!-- CONCAT(CONCAT('%',#{sequenceCode}),'%')-->
<!-- </if>-->
<!-- <if test="unitInnerCode != null and unitInnerCode != ''">-->
<!-- AND i.unit_inner_code like-->
<!-- CONCAT(CONCAT('%',#{unitInnerCode}),'%')-->
<!-- </if>-->
<if test="sortParam != null and sortParam != '' and sortRule != null and sortRule != '' ">
ORDER BY ${sortParam} ${sortRule}
</if>
</select>
<select id="getFillingSumByMonth" resultType="java.lang.Double">
select ifnull(sum(r.filling_quantity),0) from tz_cylinder_filling_record r where date_format(r.filling_endTime,'%Y-%m') = date_format(#{time},'%Y-%m') and app_id = #{appId}
</select>
<select id="getFillingSumByDate" resultType="java.lang.Double">
select ifnull(sum(r.filling_quantity),0) from tz_cylinder_filling_record r where date_format(r.filling_endTime,'%Y-%m-%d') = date_format(#{time},'%Y-%m-%d') and app_id = #{appId}
</select>
<select id="getFillingCountByMonth" resultType="java.lang.Integer">
select count(1) from tz_cylinder_filling_record r where date_format(r.filling_endTime,'%Y-%m') = date_format(#{time},'%Y-%m') and app_id = #{appId}
</select>
<select id="getCyinderFillingRecord" resultType="com.yeejoin.amos.boot.module.tzs.api.entity.ESCylinderFillingRecordDto">
SELECT
DISTINCT( r.filling_record_id),
r.sequence_nbr AS sequenceNbr,
r.filling_startTime AS fillingStarttime,
r.filling_endTime AS fillingEndtime,
r.filling_user AS fillingUser,
r.filling_quantity AS fillingQuantity,
r.temperature AS temperature,
CASE
r.abnormal
WHEN 3139 THEN
'有异常'
WHEN 3140 THEN
'正常' ELSE''
END AS abnormalStr,
b.inspector_user AS inspectorUser,
b.inspection_date AS inspectionDate,
b.check_results AS fillingResult,
b.sequence_code AS sequenceCode,
b.app_id AS appId,
b.filling_unit_name AS fillingUnitName,
af.inspector AS inspector,
af.inspection_date AS inspectionDateAfter,
af.check_results AS checkResult
FROM
tz_cylinder_filling_record r
LEFT JOIN tz_cylinder_filling b ON b.filling_before_id = r.filling_before_id
AND r.filling_before_id is NOT null
AND date_format (b.inspection_date, '%Y-%m-%d') = date_format ( r.filling_startTime, '%Y-%m-%d' )
LEFT JOIN tz_cylinder_filling_check af ON af.filling_check_id = r.filling_check_id
AND date_format (af.inspection_date,'%Y-%m-%d') = date_format ( r.filling_startTime, '%Y-%m-%d' )
LEFT JOIN tz_cylinder_info i ON b.sequence_code = i.sequence_code
WHERE
r.is_not_es IS NULL
AND b.inspection_date not like '16%'
ORDER BY r.filling_record_id
</select>
<select id="getCyinderFillingRecordInfo"
resultType="com.yeejoin.amos.boot.module.tzs.api.entity.ESCylinderFillingRecordDto">
SELECT
ci.unit_name AS unit_name,
ci.factory_num AS factoryNum,
ci.cylinder_variety AS cylinder_variety,
d2.NAME AS cylinder_variety_name,
ci.unit_inner_code AS unit_inner_code,
ci.sequence_code AS sequence_code,
ct.qrCode,
ct.electronic_label_code,
ci.app_id,
ci.credit_code,
tn.region_code
FROM
tz_cylinder_info AS ci
LEFT JOIN cb_data_dictionary AS d1 ON d1.TYPE = 'CZJZMC' AND d1.code = ci.filling_media
LEFT JOIN cb_data_dictionary AS d2 ON d2.sequence_nbr = ci.cylinder_variety
LEFT JOIN tz_cylinder_tags AS ct ON ct.sequence_code = ci.sequence_code and ct.app_id = ci.app_id
LEFT JOIN tz_cylinder_unit AS tn ON ci.app_id = tn.app_id
where
ci.sequence_code = #{sequenceCode}
and ci.app_id = #{appId}
</select>
<select id="getCylinderFillingRecordTotal" resultType="java.lang.Integer">
SELECT
COUNT(1)
FROM
tz_cylinder_filling_record r
LEFT JOIN tz_cylinder_filling b ON b.filling_before_id = r.filling_before_id
AND r.filling_before_id IS NOT NULL
AND date_format ( b.inspection_date, '%Y-%m-%d' ) = date_format ( r.filling_startTime, '%Y-%m-%d' )
LEFT JOIN tz_cylinder_filling_check af ON af.filling_check_id = r.filling_check_id
AND date_format ( af.inspection_date, '%Y-%m-%d' ) = date_format ( r.filling_startTime, '%Y-%m-%d' )
LEFT JOIN tz_cylinder_info i ON b.sequence_code = i.sequence_code
WHERE
r.is_not_es IS NULL
AND b.inspection_date NOT LIKE'16%'
</select>
</mapper>
<?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.yeejoin.amos.boot.module.flc.api.mapper.CylinderFillingUnloadDataMapper">
</mapper>
<?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.yeejoin.amos.boot.module.flc.api.mapper.CylinderFillingUnloadDataUnitMapper">
</mapper>
<?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.yeejoin.amos.boot.module.flc.api.mapper.CylinderInfoDataMapper">
</mapper>
<?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.yeejoin.amos.boot.module.flc.api.mapper.CylinderInfoDataUnitMapper">
</mapper>
<?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.yeejoin.amos.boot.module.flc.api.mapper.CylinderInfoMapper">
<select id="queryNumAndOutOfDateNum" resultType="java.util.Map">
SELECT
count( t.sequence_nbr ) AS cylinderNum,
l.expiry_date AS fillingPermitDate,
count( CASE WHEN i.next_inspection_date <![CDATA[ < ]]> now() THEN 1 END ) AS outOfDateNum
FROM
tz_cylinder_unit U
LEFT JOIN tz_cylinder_info AS t ON t.app_id = u.app_id
LEFT JOIN tz_cylinder_inspection AS i ON i.sequence_code = t.sequence_code
LEFT JOIN (SELECT * FROM tz_base_unit_licence
GROUP BY unit_code
ORDER BY expiry_date DESC) AS l ON l.unit_code = u.credit_code
WHERE
u.sequence_nbr = #{sequenceNbr}
GROUP BY u.sequence_nbr
</select>
<sql id="selectAPPIdByRegionCode">
select u.app_id from tz_cylinder_unit u where u.region_code like CONCAT('%',#{regionCode},'%')
</sql>
<select id="getMonthInfoTotal" resultType="java.lang.Integer">
select
IFNULL(count(sequence_nbr), 0)
from
tz_cylinder_info
where
date_format(sync_date ,'yyyy-mm') LIKE date_format ( NOW(), 'yyyy-mm' )
AND app_id in (<include refid="selectAPPIdByRegionCode"/>)
</select>
<select id="getLastMonthInfoTotal" resultType="java.lang.Integer">
select
IFNULL(count(sequence_nbr), 0)
from
tz_cylinder_info
where
date_format(sync_date ,'yyyy-mm') LIKE date_format ( NOW() - INTERVAL '1 month', 'yyyy-mm' )
AND app_id in (<include refid="selectAPPIdByRegionCode"/>)
</select>
<select id="getMonthBeforeLastInfoTotal" resultType="java.lang.Integer">
select
IFNULL(count(sequence_nbr), 0)
from
tz_cylinder_info
where
date_format(sync_date ,'yyyy-mm') LIKE date_format ( NOW() - INTERVAL '2 month', 'yyyy-mm' )
AND app_id in (<include refid="selectAPPIdByRegionCode"/>)
</select>
<select id="getInfoTotalByRegionCode" resultType="java.lang.Integer">
select count(sequence_nbr) from tz_cylinder_info where app_id in (<include refid="selectAPPIdByRegionCode"/>)
</select>
<select id="queryIntegirtyByAppId" resultType="java.lang.Double">
SELECT AVG(integrity) AS score_avg FROM tz_cylinder_info t where t.app_id = #{appId}
</select>
<select id="getWarnNum" resultType="java.lang.Integer">
select count(1) from view_cylider_outofdate v where v.app_id in (<include refid="selectAPPIdByRegionCode"/>)
</select>
<select id="getMonthInfoTotalUnit" resultType="java.lang.Integer">
select
IFNULL(count(sequence_nbr), 0)
from
tz_cylinder_info
where
date_format(sync_date ,'yyyy-mm') LIKE date_format ( NOW() , 'yyyy-mm' )
AND app_id = #{appId}
</select>
<select id="getLastMonthInfoTotalUnit" resultType="java.lang.Integer">
select
IFNULL(count(sequence_nbr), 0)
from
tz_cylinder_info
where
date_format(sync_date ,'yyyy-mm') LIKE date_format ( NOW() - INTERVAL '1 month', 'yyyy-mm' )
AND app_id = #{appId}
</select>
<select id="getMonthBeforeLastInfoTotalUnit" resultType="java.lang.Integer">
select
IFNULL(count(sequence_nbr), 0)
from
tz_cylinder_info
where
date_format(sync_date ,'yyyy-mm') LIKE date_format ( NOW() - INTERVAL '2 month', 'yyyy-mm' )
AND app_id = #{appId}
</select>
<select id="countOverDateNumber" resultType="java.lang.Integer">
SELECT
count(1)
FROM tz_cylinder_info ci
where
ci.early_warning_level = #{earlyWarningLevel}
</select>
<select id="queryPageListByEarlyWarningLevel"
resultType="com.yeejoin.amos.boot.module.flc.api.dto.CylinderInfoDto">
select
ci.sequence_code,
ci.unit_name,
ci.factory_num,
ci.inspection_date,
ci.next_inspection_date,
ci.early_warning_level,
ci.early_warning_level_cal_date,
ci.longitude,
ci.latitude,
eu.address
from
tz_cylinder_info ci
left join tz_end_user eu on ci.end_custom_code = eu.custom_code
where
ci.early_warning_level = #{earlyWarningLevel}
order by ci.next_inspection_date
</select>
<select id="listWithRegionCode" resultType="com.yeejoin.amos.boot.module.flc.api.dto.CylinderInfoDto">
SELECT
ci.*,
cu.region_code
FROM
tz_cylinder_info ci
LEFT JOIN tz_cylinder_unit cu ON cu.app_id = ci.app_id
WHERE
cu.region_code LIKE concat('%', #{regionCode}, '%')
</select>
<select id="cyinderInfoList" resultType="com.yeejoin.amos.boot.module.flc.api.dto.CylinderInfoDto">
SELECT
ci.sequence_nbr AS sequence_nbr,
ci.unit_name AS unit_name,
ci.factory_num AS factory_num,
ci.cylinder_status AS cylinder_status,
ci.cylinder_variety AS cylinder_variety,
ci.volume AS volume,
ci.manufacturing_date AS manufacturing_date,
ci.manufacturing_unit AS manufacturing_unit,
ci.unit_inner_code AS unit_inner_code,
ci.sequence_code AS sequence_code,
ci.early_warning_level AS early_warning_level,
ci.early_warning_level_cal_date AS early_warning_level_cal_date,
ci.end_custom_code AS end_custom_code,
ci.rec_date AS rec_date,
ci.rec_user_id AS rec_user_id,
ci.sync_date AS sync_date,
ci.sync_state AS sync_state,
ci.app_id AS app_id,
ci.integrity AS integrity,
ci.longitude AS longitude,
ci.latitude AS latitude,
ci.credit_code AS credit_code,
ci.filling_media AS filling_media,
ci.product_name AS product_name,
ci.product_qualified AS product_qualified,
ci.proof_quality AS proof_quality,
ci.supervision_inspec AS supervision_inspec,
ci.type_experiments AS type_experiments,
ci.valve_manufactur_unit AS valve_manufactur_unit,
ci.nominal_work_pressure AS nominal_work_pressure,
d1.name AS filling_media_name,
d2.name AS cylinder_variety_name,
d3.name AS cylinder_status_str,
ct.qrCode,
ct.electronic_label_code
FROM
tz_cylinder_info AS ci
LEFT JOIN cb_data_dictionary AS d1 ON d1.type = 'CZJZMC' AND d1.code = ci.filling_media
LEFT JOIN cb_data_dictionary AS d2 ON d2.sequence_nbr = ci.cylinder_variety
LEFT JOIN cb_data_dictionary AS d3 ON d3.sequence_nbr = ci.cylinder_status
LEFT JOIN tz_cylinder_tags AS ct ON ct.sequence_code = ci.sequence_code
<where>
<if test="appids != null and appids.size > 0 ">
and ci.app_id in
<foreach collection="appids" index="index" item="item" close=")" open="(" separator=",">
#{item}
</foreach>
</if>
<if test="cylinderInfoDto.appId != null and cylinderInfoDto.appId != '' ">
and ci.app_id = #{cylinderInfoDto.appId}
</if>
<if test="cylinderInfoDto.unitName != null and cylinderInfoDto.unitName != '' ">
and ci.unit_name like concat('%',#{cylinderInfoDto.unitName},'%')
</if>
<if test="cylinderInfoDto.factoryNum != null and cylinderInfoDto.factoryNum != '' ">
and ci.factory_num like concat('%',#{cylinderInfoDto.factoryNum},'%')
</if>
<if test="cylinderInfoDto.cylinderVariety != null and cylinderInfoDto.cylinderVariety != '' ">
and ci.cylinder_variety = #{cylinderInfoDto.cylinderVariety}
</if>
<if test="cylinderInfoDto.sequenceCode != null and cylinderInfoDto.sequenceCode != '' ">
and ci.sequence_code like concat('%',#{cylinderInfoDto.sequenceCode},'%')
</if>
<if test="cylinderInfoDto.unitInnerCode != null and cylinderInfoDto.unitInnerCode != '' ">
and ci.unit_inner_code like concat('%',#{cylinderInfoDto.unitInnerCode},'%')
</if>
<if test="cylinderInfoDto.cylinderStatus != null and cylinderInfoDto.cylinderStatus != '' ">
and ci.cylinder_status = #{cylinderInfoDto.cylinderStatus}
</if>
<if test="cylinderInfoDto.manufacturingUnit != null and cylinderInfoDto.manufacturingUnit != '' ">
and ci.manufacturing_unit like concat('%',#{cylinderInfoDto.manufacturingUnit},'%')
</if>
<if test="cylinderInfoDto.creditCode != null and cylinderInfoDto.creditCode != '' ">
and ci.credit_code like concat('%',#{cylinderInfoDto.creditCode},'%')
</if>
<if test="cylinderInfoDto.qrCode != null and cylinderInfoDto.qrCode != '' ">
and ct.qrCode like concat('%',#{cylinderInfoDto.qrCode},'%')
</if>
<if test="cylinderInfoDto.electronicLabelCode != null and cylinderInfoDto.electronicLabelCode != '' ">
and ct.electronic_label_code like concat('%',#{cylinderInfoDto.electronicLabelCode},'%')
</if>
<if test="cylinderInfoDto.SupervisionCode != null and cylinderInfoDto.SupervisionCode != '' ">
and ci.supervision_code like concat('%',#{cylinderInfoDto.SupervisionCode},'%')
</if>
ORDER BY ci.sync_date DESC
</where>
</select>
<select id="cyinderOutInfoList" resultType="com.yeejoin.amos.boot.module.flc.api.dto.CylinderInfoDto">
SELECT
ci.sequence_nbr AS sequence_nbr,
ci.unit_name AS unit_name,
ci.factory_num AS factory_num,
ci.cylinder_status AS cylinder_status,
ci.cylinder_variety AS cylinder_variety,
ci.volume AS volume,
ci.manufacturing_date AS manufacturing_date,
ci.manufacturing_unit AS manufacturing_unit,
ci.unit_inner_code AS unit_inner_code,
ci.sequence_code AS sequence_code,
ci.early_warning_level AS early_warning_level,
ci.early_warning_level_cal_date AS early_warning_level_cal_date,
ci.end_custom_code AS end_custom_code,
ci.rec_date AS rec_date,
ci.rec_user_id AS rec_user_id,
ci.sync_date AS sync_date,
ci.sync_state AS sync_state,
ci.app_id AS app_id,
ci.integrity AS integrity,
ci.longitude AS longitude,
ci.latitude AS latitude,
ci.credit_code AS credit_code,
ci.filling_media AS filling_media,
ci.product_name AS product_name,
ci.product_qualified AS product_qualified,
ci.proof_quality AS proof_quality,
ci.supervision_inspec AS supervision_inspec,
ci.type_experiments AS type_experiments,
ci.valve_manufactur_unit AS valve_manufactur_unit,
ci.nominal_work_pressure AS nominal_work_pressure,
d1.name AS filling_media_name,
d2.name AS cylinder_variety_name,
d3.name AS cylinder_status_str,
ct.qrCode,
ct.electronic_label_code
FROM
tz_cylinder_inspection AS isp
LEFT JOIN tz_cylinder_info AS ci ON ci.sequence_code = isp.sequence_code
LEFT JOIN cb_data_dictionary AS d1 ON d1.type = 'CZJZMC' AND d1.code = ci.filling_media
LEFT JOIN cb_data_dictionary AS d2 ON d2.sequence_nbr = ci.cylinder_variety
LEFT JOIN cb_data_dictionary AS d3 ON d3.sequence_nbr = ci.cylinder_status
LEFT JOIN tz_cylinder_tags AS ct ON ct.sequence_code = ci.sequence_code
WHERE isp.next_inspection_date <![CDATA[ < ]]> now()
<if test="appids != null and appids.size > 0 ">
and ci.app_id in
<foreach collection="appids" index="index" item="item" close=")" open="(" separator=",">
#{item}
</foreach>
</if>
</select>
<select id="getCyinderInfoList" resultType="com.yeejoin.amos.boot.module.flc.api.dto.CylinderInfoDto">
SELECT
ci.sequence_nbr AS sequence_nbr,
ci.unit_name AS unit_name,
ci.factory_num AS factory_num,
ci.cylinder_status AS cylinder_status,
ci.cylinder_variety AS cylinder_variety,
ci.volume AS volume,
ci.manufacturing_date AS manufacturing_date,
ci.manufacturing_unit AS manufacturing_unit,
ci.unit_inner_code AS unit_inner_code,
ci.sequence_code AS sequence_code,
ci.early_warning_level AS early_warning_level,
ci.early_warning_level_cal_date AS early_warning_level_cal_date,
ci.end_custom_code AS end_custom_code,
ci.rec_date AS rec_date,
ci.rec_user_id AS rec_user_id,
ci.sync_date AS sync_date,
ci.sync_state AS sync_state,
ci.app_id AS app_id,
ci.integrity AS integrity,
ci.longitude AS longitude,
ci.latitude AS latitude,
ci.credit_code AS credit_code,
ci.filling_media AS filling_media,
ci.product_name AS product_name,
ci.product_qualified AS product_qualified,
ci.proof_quality AS proof_quality,
ci.supervision_inspec AS supervision_inspec,
ci.type_experiments AS type_experiments,
ci.valve_manufactur_unit AS valve_manufactur_unit,
ci.nominal_work_pressure AS nominal_work_pressure,
d1.name AS filling_media_name,
d2.name AS cylinder_variety_name,
d3.name AS cylinder_status_str,
ct.qrCode,
ct.electronic_label_code,
cu.region_code
FROM
tz_cylinder_info AS ci
LEFT JOIN cb_data_dictionary AS d1 ON d1.type = 'CZJZMC' AND d1.code = ci.filling_media
LEFT JOIN cb_data_dictionary AS d2 ON d2.sequence_nbr = ci.cylinder_variety
LEFT JOIN cb_data_dictionary AS d3 ON d3.sequence_nbr = ci.cylinder_status
LEFT JOIN tz_cylinder_tags AS ct ON ct.sequence_code = ci.sequence_code
LEFT JOIN tz_cylinder_unit AS cu ON ci.app_id = cu.app_id
where ci.is_not_es IS NULL
AND region_code is not null
</select>
<select id="getInfoTotal" resultType="java.lang.Integer">
SELECT
count(1)
FROM
tz_cylinder_info AS ci
LEFT JOIN cb_data_dictionary AS d1 ON d1.type = 'CZJZMC' AND d1.code = ci.filling_media
LEFT JOIN cb_data_dictionary AS d2 ON d2.sequence_nbr = ci.cylinder_variety
LEFT JOIN cb_data_dictionary AS d3 ON d3.sequence_nbr = ci.cylinder_status
LEFT JOIN tz_cylinder_tags AS ct ON ct.sequence_code = ci.sequence_code
LEFT JOIN tz_cylinder_unit AS cu ON ci.app_id = cu.app_id
where ci.is_not_es IS NULL
AND region_code is not null
</select>
</mapper>
<?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.yeejoin.amos.boot.module.flc.api.mapper.CylinderInspectionMapper">
<select id="queryOutOfDateCylinder" resultType="com.yeejoin.amos.boot.module.flc.api.entity.CylinderInfo">
SELECT
*
FROM
tz_cylinder_info info
LEFT JOIN tz_cylinder_inspection ins ON ins.sequence_code = info.sequence_code
WHERE TO_DAYS(ins.next_inspection_date) - TO_DAYS(NOW()) &lt;= 20
AND info.app_id = #{appId}
</select>
</mapper>
<?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.yeejoin.amos.boot.module.flc.api.mapper.CylinderIntegrityDataMapper">
</mapper>
<?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.yeejoin.amos.boot.module.flc.api.mapper.CylinderIntegrityDataUnitMapper">
</mapper>
<?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.yeejoin.amos.boot.module.flc.api.mapper.CylinderTagsDataUnitMapper">
</mapper>
<?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.yeejoin.amos.boot.module.flc.api.mapper.CylinderTagsMapper">
<select id="queryIntegirtyByAppId" resultType="java.lang.Double">
SELECT AVG(integrity) AS score_avg FROM tz_cylinder_tags t where t.app_id = #{appId}
</select>
</mapper>
<?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.yeejoin.amos.boot.module.flc.api.mapper.CylinderUnitDataMapper">
</mapper>
<?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.yeejoin.amos.boot.module.flc.api.mapper.CylinderUnitMapper">
<select id="getLastMonthUnitTotal" resultType="java.lang.Integer">
select IFNULL(count(sequence_nbr), 0) from tz_cylinder_unit where date_format(sync_date ,'yyyy-mm') LIKE date_format ( NOW( ) - INTERVAL '1 month', 'yyyy-mm' ) AND region_code like CONCAT('%',#{regionCode},'%')
</select>
<select id="getMonthBeforeLastUnitTotal" resultType="java.lang.Integer">
select IFNULL(count(sequence_nbr), 0) from tz_cylinder_unit where date_format(sync_date ,'yyyy-mm') LIKE date_format ( NOW( ) - INTERVAL '2 month', 'yyyy-mm' ) AND region_code like CONCAT('%',#{regionCode},'%')
</select>
<select id="getUnitTotalByRegionCode" resultType="java.lang.Integer">
select count(sequence_nbr) from tz_cylinder_unit where region_code like CONCAT('%',#{regionCode},'%')
</select>
<select id="getWarnNum" resultType="java.lang.Integer">
select count(1) from view_unit_outofdate v where v.app_id in (
select u.app_id from tz_cylinder_unit u where u.region_code like CONCAT('%',#{regionCode},'%')
)
</select>
<select id="getWarnNumByAppId" resultType="java.lang.Integer">
select count(1) from view_cylider_outofdate v where v.app_id =#{appId}
</select>
<select id="getLicenseOutOfDate" resultType="java.lang.Integer">
select count(1) from view_unit_outofdate v where v.credit_code = #{creditCode}
</select>
<select id="getThisMonthUnitTotalByRegionCode" resultType="java.lang.Integer">
select count(sequence_nbr) from tz_cylinder_unit where date_format(sync_date ,'yyyy-mm') LIKE date_format ( NOW( ) ,'yyyy-mm') and region_code like CONCAT('%',#{regionCode},'%')
</select>
</mapper>
<?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.yeejoin.amos.boot.module.flc.api.mapper.CylinderUnloadFakeMapper">
</mapper>
<?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.yeejoin.amos.boot.module.flc.api.mapper.EndUserMapper">
</mapper>
<?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.yeejoin.amos.boot.module.flc.api.mapper.TzCarcylMapper">
<select id="pageByOrgCode" resultType="com.yeejoin.amos.boot.module.flc.api.dto.TzCarcylRegDto">
SELECT
UI.sequence_nbr,
UC.compont_name,
UC.compont_code,
UC.dept,
UC.address,
UC.legal_person,
UC.legal_phone,
UC.supervise_org_code,
UI.car_num,
UI.gas_dept_name,
UI.use_num,
UI.start_time,
UI.end_time
FROM
tz_carcyl_user_info UI
LEFT JOIN (
SELECT
UC.compont_name,
UC.compont_code,
UC.dept,
EI.address,
EI.legal_person,
EI.legal_phone,
UC.instance_id,
EI.supervise_org_code
FROM
tz_carcyl_user_company UC
LEFT JOIN tz_base_enterprise_info EI ON UC.compont_code = EI.use_code
) AS UC ON UC.instance_id = UI.instance_id
<where>
<if
test="TzCarcylRegDto.compontName!=null and TzCarcylRegDto.compontName!='' ">
AND UC.compont_name LIKE
CONCAT('%',#{TzCarcylRegDto.compontName},'%')
</if>
<if
test="TzCarcylRegDto.compontCode!=null and TzCarcylRegDto.compontCode!='' ">
AND UC.compont_code LIKE
CONCAT('%',#{TzCarcylRegDto.compontCode},'%')
</if>
<if
test="TzCarcylRegDto.dept!=null and TzCarcylRegDto.dept!='' ">
AND UC.dept LIKE
CONCAT('%',#{TzCarcylRegDto.dept},'%')
</if>
<if
test="TzCarcylRegDto.address!=null and TzCarcylRegDto.address!='' ">
AND UC.address LIKE
CONCAT('%',#{TzCarcylRegDto.address},'%')
</if>
<if
test="TzCarcylRegDto.legalPerson!=null and TzCarcylRegDto.legalPerson!='' ">
AND UC.legal_person LIKE
CONCAT('%',#{TzCarcylRegDto.legalPerson},'%')
</if>
<if
test="TzCarcylRegDto.legalPhone!=null and TzCarcylRegDto.legalPhone!='' ">
AND UC.legal_phone LIKE
CONCAT('%',#{TzCarcylRegDto.legalPhone},'%')
</if>
<if
test="TzCarcylRegDto.carNum!=null and TzCarcylRegDto.carNum!='' ">
AND UI.car_num LIKE
CONCAT('%',#{TzCarcylRegDto.carNum},'%')
</if>
<if
test="TzCarcylRegDto.gasDeptName!=null and TzCarcylRegDto.gasDeptName!='' ">
AND UI.gas_dept_name LIKE
CONCAT('%',#{TzCarcylRegDto.gasDeptName},'%')
</if>
<if
test="TzCarcylRegDto.useNum!=null and TzCarcylRegDto.useNum!='' ">
AND UI.use_num LIKE
CONCAT('%',#{TzCarcylRegDto.useNum},'%')
</if>
<if
test="TzCarcylRegDto.startTime!=null and TzCarcylRegDto.startTime!='' ">
AND UI.start_time LIKE
CONCAT('%',#{TzCarcylRegDto.startTime},'%')
</if>
<if
test="TzCarcylRegDto.endTime!=null and TzCarcylRegDto.endTime!='' ">
AND UI.end_time LIKE
CONCAT('%',#{TzCarcylRegDto.endTime},'%')
</if>
<if
test="superviseOrgCode!=null and superviseOrgCode!='' ">
AND UC.supervise_org_code LIKE
CONCAT('%',#{superviseOrgCode},'%')
</if>
</where>
</select>
<select id="pageByCompanyCode" resultType="com.yeejoin.amos.boot.module.flc.api.dto.TzCarcylRegDto">
SELECT
UI.sequence_nbr,
UC.compont_name,
UC.compont_code,
UC.dept,
UC.address,
UC.legal_person,
UC.legal_phone,
UC.supervise_org_code,
UI.car_num,
UI.gas_dept_name,
UI.use_num,
UI.start_time,
UI.end_time
FROM
tz_carcyl_user_info UI
LEFT JOIN (
SELECT
UC.compont_name,
UC.compont_code,
UC.dept,
EI.address,
EI.legal_person,
EI.legal_phone,
UC.instance_id,
EI.supervise_org_code
FROM
tz_carcyl_user_company UC
LEFT JOIN tz_base_enterprise_info EI ON UC.compont_code = EI.use_code
) AS UC ON UC.instance_id = UI.instance_id
<where>
<if
test="TzCarcylRegDto.compontName!=null and TzCarcylRegDto.compontName!='' ">
AND UC.compont_name LIKE
CONCAT('%',#{TzCarcylRegDto.compontName},'%')
</if>
<if
test="TzCarcylRegDto.compontCode!=null and TzCarcylRegDto.compontCode!='' ">
AND UC.compont_code LIKE
CONCAT('%',#{TzCarcylRegDto.compontCode},'%')
</if>
<if
test="TzCarcylRegDto.dept!=null and TzCarcylRegDto.dept!='' ">
AND UC.dept LIKE
CONCAT('%',#{TzCarcylRegDto.dept},'%')
</if>
<if
test="TzCarcylRegDto.address!=null and TzCarcylRegDto.address!='' ">
AND UC.address LIKE
CONCAT('%',#{TzCarcylRegDto.address},'%')
</if>
<if
test="TzCarcylRegDto.legalPerson!=null and TzCarcylRegDto.legalPerson!='' ">
AND UC.legal_person LIKE
CONCAT('%',#{TzCarcylRegDto.legalPerson},'%')
</if>
<if
test="TzCarcylRegDto.legalPhone!=null and TzCarcylRegDto.legalPhone!='' ">
AND UC.legal_phone LIKE
CONCAT('%',#{TzCarcylRegDto.legalPhone},'%')
</if>
<if
test="TzCarcylRegDto.carNum!=null and TzCarcylRegDto.carNum!='' ">
AND UI.car_num LIKE
CONCAT('%',#{TzCarcylRegDto.carNum},'%')
</if>
<if
test="TzCarcylRegDto.gasDeptName!=null and TzCarcylRegDto.gasDeptName!='' ">
AND UI.gas_dept_name LIKE
CONCAT('%',#{TzCarcylRegDto.gasDeptName},'%')
</if>
<if
test="TzCarcylRegDto.useNum!=null and TzCarcylRegDto.useNum!='' ">
AND UI.use_num LIKE
CONCAT('%',#{TzCarcylRegDto.useNum},'%')
</if>
<if
test="TzCarcylRegDto.startTime!=null and TzCarcylRegDto.startTime!='' ">
AND UI.start_time LIKE
CONCAT('%',#{TzCarcylRegDto.startTime},'%')
</if>
<if
test="TzCarcylRegDto.endTime!=null and TzCarcylRegDto.endTime!='' ">
AND UI.end_time LIKE
CONCAT('%',#{TzCarcylRegDto.endTime},'%')
</if>
<if
test="companyCode!=null and companyCode!='' ">
AND UC.compont_code LIKE
CONCAT('%',#{companyCode},'%')
</if>
</where>
</select>
<select id="getUserInfoger" resultType="com.yeejoin.amos.boot.module.flc.api.dto.TzCarcylRegDto">
SELECT
UI.sequence_nbr,
UC.compont_name,
UC.compont_code,
UC.dept,
UC.address,
UC.legal_person,
UC.legal_phone,
UI.car_num,
UI.gas_dept_name,
UI.use_num,
UI.start_time,
UI.end_time
FROM
tz_carcyl_user_info UI
LEFT JOIN (
SELECT
UC.compont_name,
UC.compont_code,
UC.dept,
EI.address,
EI.legal_person,
EI.legal_phone,
UC.instance_id
FROM
tz_carcyl_user_company UC
LEFT JOIN tz_base_enterprise_info EI ON UC.compont_code = EI.use_code
) AS UC ON UC.instance_id = UI.instance_id
WHERE UI.sequence_nbr = #{sequenceNbr}
</select>
<select id="getUseNum" resultType="java.lang.String">
SELECT
use_num
FROM
tz_carcyl_user_info
WHERE sequence_nbr = #{sequenceNbr}
</select>
<select id="getFillingInfo" resultType="com.yeejoin.amos.boot.module.flc.api.dto.TzCarcylFillInfoDto">
SELECT
FC.company_name,
FC.company_code,
FC.dept,
FI.sequence_nbr,
FI.instance_id,
FI.use_code,
FI.gas_date,
FI.gas_check_name,
FI.gas_check_name,
FI.gas_name,
FI.gas_media
FROM
tz_carcyl_filling_info AS FI
LEFT JOIN tz_carcyl_filling_company AS FC ON FC.instance_id=FI.instance_id
WHERE FI.use_code=#{useCode}
</select>
<select id="getCheckingInfo" resultType="com.yeejoin.amos.boot.module.flc.api.dto.TzCarcylInspectDto">
SELECT
CC.check_dept_name,
CC.organization_code,
CC.organization_dept_code,
CI.use_code,
CI.check_date,
CI.next_check_date,
CI.check_result,
CI.gas_disable_date,
CI.main_problem
FROM
tz_carcyl_check_info AS CI
LEFT JOIN tz_carcyl_check_company AS CC ON CC.instance_id = CI.instance_id
WHERE CI.use_code=#{useCode}
</select>
</mapper>
<?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.yeejoin.amos.boot.module.flc.api.mapper.TzCylinderMapper">
<select id="getTzCylinderInfoList" resultType="com.yeejoin.amos.boot.module.flc.api.dto.TzCylinderInfoDto">
SELECT
CI.sequence_nbr,
CI.unit_name,
CI.cylinder_variety,
CI.product_name,
CI.factory_num,
CI.unit_inner_code,
CI.filling_media,
CI.manufacturing_unit,
CI.manufacturing_date,
CI.valve_manufactur_unit,
CI.cylinder_status
FROM
tz_cylinder_info AS CI
LEFT JOIN
tz_base_enterprise_info AS EI ON CI.credit_code=EI.use_code
<where>
<if
test="superviseOrgCode!=null and superviseOrgCode!='' ">
AND EI.supervise_org_code LIKE
CONCAT('%',#{superviseOrgCode},'%')
</if>
<if
test="tzCylinderInfoDto.unitName!=null and tzCylinderInfoDto.unitName!='' ">
AND CI.unit_name LIKE
CONCAT('%',#{tzCylinderInfoDto.unitName},'%')
</if>
<if
test="tzCylinderInfoDto.cylinderVariety!=null and tzCylinderInfoDto.cylinderVariety!='' ">
AND CI.cylinder_variety LIKE
CONCAT('%',#{tzCylinderInfoDto.cylinderVariety},'%')
</if>
<if
test="tzCylinderInfoDto.productName!=null and tzCylinderInfoDto.productName!='' ">
AND CI.product_name LIKE
CONCAT('%',#{tzCylinderInfoDto.productName},'%')
</if>
<if
test="tzCylinderInfoDto.factoryNum!=null and tzCylinderInfoDto.factoryNum!='' ">
AND CI.factory_num LIKE
CONCAT('%',#{tzCylinderInfoDto.factoryNum},'%')
</if>
<if
test="tzCylinderInfoDto.unitInnerCode!=null and tzCylinderInfoDto.unitInnerCode!='' ">
AND CI.unit_inner_code LIKE
CONCAT('%',#{tzCylinderInfoDto.unitInnerCode},'%')
</if>
<if
test="tzCylinderInfoDto.fillingMedia!=null and tzCylinderInfoDto.fillingMedia!='' ">
AND CI.filling_media LIKE
CONCAT('%',#{tzCylinderInfoDto.fillingMedia},'%')
</if>
<if
test="tzCylinderInfoDto.manufacturingUnit!=null and tzCylinderInfoDto.manufacturingUnit!='' ">
AND CI.manufacturing_unit LIKE
CONCAT('%',#{tzCylinderInfoDto.manufacturingUnit},'%')
</if>
<if
test="tzCylinderInfoDto.manufacturingDate!=null and tzCylinderInfoDto.manufacturingDate!='' ">
AND CI.manufacturing_date LIKE
CONCAT('%',#{tzCylinderInfoDto.manufacturingDate},'%')
</if>
<if
test="tzCylinderInfoDto.valveManufacturUnit!=null and tzCylinderInfoDto.valveManufacturUnit!='' ">
AND CI.valve_manufactur_unit LIKE
CONCAT('%',#{tzCylinderInfoDto.valveManufacturUnit},'%')
</if>
<if
test="tzCylinderInfoDto.cylinderStatus!=null and tzCylinderInfoDto.cylinderStatus!='' ">
AND CI.cylinder_status LIKE
CONCAT('%',#{tzCylinderInfoDto.cylinderStatus},'%')
</if>
</where>
</select>
<select id="getTzCylinderInfoDto" resultType="com.yeejoin.amos.boot.module.flc.api.dto.TzCylinderInfoDto">
SELECT
CI.sequence_nbr,
CI.unit_name,
CI.cylinder_variety,
CI.product_name,
CI.factory_num,
CI.unit_inner_code,
CI.filling_media,
CI.manufacturing_unit,
CI.manufacturing_date,
CI.valve_manufactur_unit,
CI.cylinder_status
FROM
tz_cylinder_info AS CI
WHERE CI.sequence_nbr = #{sequenceNbr}
</select>
<select id="getSequencCode" resultType="java.lang.String">
SELECT sequence_code FROM tz_cylinder_info WHERE sequence_nbr=#{sequenceNbr}
</select>
<select id="getTzCylinderProduceDto" resultType="com.yeejoin.amos.boot.module.flc.api.dto.TzCylinderProduceDto">
SELECT
CI.sequence_nbr,
CI.manufacturing_unit,
CI.manufacturing_date,
CI.valve_manufactur_unit,
CI.nominal_work_pressure,
CI.volume,
CI.product_qualified,
CI.proof_quality,
CI.supervision_inspec,
CI.type_experiments
FROM
tz_cylinder_info CI
WHERE CI.sequence_code =#{SequenceCode}
</select>
<select id="getTzCylinderTagsDto" resultType="com.yeejoin.amos.boot.module.flc.api.dto.TzCylinderTagsDto">
SELECT
CT.sequence_nbr,
CT.sequence_code,
CT.qrCode,
CT.electronic_label_code,
CT.gas_cylinder_stamp
FROM tz_cylinder_tags CT
WHERE CT.sequence_code = #{SequenceCode}
</select>
<select id="getTzCylinderInspectionDto" resultType="com.yeejoin.amos.boot.module.flc.api.dto.TzCylinderInspectionDto">
SELECT
CI.sequence_nbr,
CI.sequence_code,
CI.inspection_unit,
CI.inspection_date,
(select name from cb_data_dictionary where SEQUENCE_NBR = CI.inspection_result) inspection_result,
CI.scrap_quantity,
CI.next_inspection_date
FROM tz_cylinder_inspection CI
WHERE CI.sequence_code = #{SequenceCode}
ORDER BY CI.inspection_date DESC
</select>
<select id="getTzCylinderFillingDto" resultType="com.yeejoin.amos.boot.module.flc.api.dto.TzCylinderFillingDto">
SELECT
CF.inspector_user AS inspector_before_user,
CF.inspection_date AS inspection_before_date,
FC.inspection_date AS inspection_after_date,
FC.inspector AS inspector_after,
FR.sequence_nbr,
FC.filling_check_id,
FR.filling_quantity,
CF.sequence_code,
FR.filling_before_id,
FR.filling_startTime,
FR.filling_endTime,
FR.filling_user,
FR.inspector_name,
FR.temperature,
FR.abnormal,
CF.check_results AS check_results_before,
FC.check_results AS check_results_after
FROM
tz_cylinder_filling_record AS FR
LEFT JOIN tz_cylinder_filling AS CF ON CF.filling_before_id = FR.filling_before_id
LEFT JOIN tz_cylinder_filling_check AS FC ON FC.filling_check_id = FR.filling_check_id
WHERE
CF.sequence_code = #{sequence_code}
ORDER BY FR.filling_startTime DESC
</select>
<select id="getTzCylinderBeforeCheck" resultType="com.yeejoin.amos.boot.module.flc.api.dto.TzCylinderBeforeCheckDto">
SELECT
CF.is_valid,
CF.same,
CF.is_regulations,
CF.is_compliance_withGBT,
CF.have_still_pressure,
CF.is_complete,
CF.have_security_documents,
CF.fill_before_item
FROM tz_cylinder_filling AS CF
WHERE CF.filling_before_id=#{fillingBeforeId}
</select>
<select id="getTzCylinderCheckItem" resultType="com.yeejoin.amos.boot.module.flc.api.dto.TzCylinderCheckDto">
SELECT
*
FROM
tz_cylinder_check_item
WHERE item!=''
</select>
<select id="getTzCylinderAfterCheck" resultType="com.yeejoin.amos.boot.module.flc.api.dto.TzCylinderAfterCheckDto">
SELECT
FC.within_scope,
FC.sealed_state,
FC.defective,
FC.abnormal_temperature,
FC.warning_sign
FROM tz_cylinder_filling_check AS FC
WHERE FC.filling_check_id=#{fillingCheckId}
</select>
<select id="getTzCylinderAfterCheckItem" resultType="com.yeejoin.amos.boot.module.flc.api.dto.TzCylinderCheckDto">
SELECT
after_item AS item,
after_explain AS "explain",
after_result AS "result"
FROM
tz_cylinder_check_item
WHERE after_item!=''
</select>
</mapper>
package com.yeejoin.amos.boot.module.tzs.flc.api.mapper;
package com.yeejoin.amos.boot.module.flc.api.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.flc.api.entity.EquipmentAssociated;
......
package com.yeejoin.amos.boot.module.tzs.flc.api.mapper;
package com.yeejoin.amos.boot.module.flc.api.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.flc.api.entity.EquipmentIndexInform;
......
package com.yeejoin.amos.boot.module.tzs.flc.api.mapper;
package com.yeejoin.amos.boot.module.flc.api.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.flc.api.entity.EquipmentIndex;
import com.yeejoin.amos.boot.module.tzs.flc.api.entity.EquipmentIndex;
/**
* 设备指标 Mapper 接口
......
......@@ -2,7 +2,6 @@ package com.yeejoin.amos.boot.module.flc.api.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.flc.api.entity.PersonQuality;
import com.yeejoin.amos.boot.module.tzs.flc.api.entity.PersonQuality;
/**
* 企业人员资质信息表 Mapper 接口
......
package com.yeejoin.amos.boot.module.flc.api.service;
/**
* 气瓶终端用户接口类
*
* @author system_generator
* @date 2022-04-21
*/
public interface IEndUserService {
}
<?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.yeejoin.amos.boot.module.flc.api.mapper.EquipmentAssociatedMapper">
</mapper>
<?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.yeejoin.amos.boot.module.api.mapper.EquipmentCategoryMapper">
<select id="getCategoryCount" resultType="java.util.Map">
SELECT temp.code category,
IFNULL ( A.count, 0 ) waitClaim,
IFNULL ( b.count, 0 ) alreadyClaim,
IFNULL ( C.count, 0 ) refuseClaim
FROM
(
SELECT
code
FROM
"tz_equipment_category"
WHERE
code LIKE'%000'
AND code <![CDATA[ <> ]]> 7000
AND code <![CDATA[ <> ]]> 'F000') temp LEFT JOIN
(
SELECT
"EQU_LIST",
COUNT ( * )
FROM
idx_biz_jg_use_info ibjui
LEFT JOIN idx_biz_jg_supervision_info ibjsi ON ibjui.RECORD = ibjsi.RECORD
LEFT JOIN idx_biz_jg_register_info ibjri ON ibjui.RECORD = ibjri.RECORD
LEFT JOIN idx_biz_jg_other_info ibjoi ON ibjui.RECORD = ibjoi.RECORD
WHERE
ibjoi.claim_status = '待认领'
AND ibjui."USE_UNIT_CREDIT_CODE" = #{companyCode}
GROUP BY
"EQU_LIST"
) A on temp.code = A."EQU_LIST" LEFT JOIN (
SELECT
"EQU_LIST",
COUNT ( * )
FROM
idx_biz_jg_use_info ibjui
LEFT JOIN idx_biz_jg_supervision_info ibjsi ON ibjui.RECORD = ibjsi.RECORD
LEFT JOIN idx_biz_jg_register_info ibjri ON ibjui.RECORD = ibjri.RECORD
LEFT JOIN idx_biz_jg_other_info ibjoi ON ibjui.RECORD = ibjoi.RECORD
WHERE
ibjoi.claim_status = '已认领'
AND ibjui."USE_UNIT_CREDIT_CODE" = #{companyCode}
GROUP BY
"EQU_LIST"
) b ON temp.code = b."EQU_LIST"
LEFT JOIN (
SELECT
"EQU_LIST",
COUNT ( * )
FROM
idx_biz_jg_use_info ibjui
LEFT JOIN idx_biz_jg_supervision_info ibjsi ON ibjui.RECORD = ibjsi.RECORD
LEFT JOIN idx_biz_jg_register_info ibjri ON ibjui.RECORD = ibjri.RECORD
LEFT JOIN idx_biz_jg_other_info ibjoi ON ibjui.RECORD = ibjoi.RECORD
WHERE
ibjoi.claim_status = '已拒领'
AND ibjui."USE_UNIT_CREDIT_CODE" = #{companyCode}
GROUP BY
"EQU_LIST"
) C ON temp.code = C."EQU_LIST"
</select>
<select id="getAdministrativeDivision" resultType="java.util.Map">
SELECT
code,
type,
type_desc
FROM
cb_data_dictionary
WHERE
type= #{division}
AND extend LIKE CONCAT('%',#{county},'%')
</select>
<select id="getSrcee" resultType="java.util.Map">
SELECT
*
from
${tableName}
<where>
<if test="orgBranchName !=null and orgBranchName != ''">
and ORG_BRANCH_NAME is not NULL
and ORG_BRANCH_NAME !=''
GROUP BY ORG_BRANCH_NAME
</if>
<if test="equList !=null and equList != ''">
and EQU_LIST is not NULL
and EQU_LIST !=''
GROUP BY EQU_LIST
</if>
<if test="equCategory !=null and equCategory != ''">
and EQU_CATEGORY is not NULL
and EQU_CATEGORY !=''
GROUP BY EQU_CATEGORY
</if>
<if test="usePlace !=null and usePlace != ''">
and
USE_PLACE is not NULL
and USE_PLACE !=''
GROUP BY USE_PLACE
</if>
<if test="equState !=null and equState != ''">
and
EQU_STATE is not NULL
and EQU_STATE !=''
GROUP BY EQU_STATE
</if>
</where>
</select>
<select id="getCategoryAndDefineByRecord" resultType="java.util.Map">
SELECT
"EQU_CATEGORY",
"EQU_DEFINE"
FROM
idx_biz_jg_register_info
WHERE
"RECORD" = #{record}
</select>
<select id="getAllUnit" resultType="java.util.Map">
SELECT
ibjui.USE_UNIT_CREDIT_CODE use_code,
ibjsi.ORG_BRANCH_CODE supervise_org_code
FROM
idx_biz_jg_use_info ibjui
LEFT JOIN idx_biz_jg_supervision_info ibjsi ON ibjui."RECORD" = ibjsi."RECORD"
WHERE
ibjui.USE_UNIT_CREDIT_CODE <![CDATA[ <> ]]> ''
AND (lengthb(ibjui.USE_UNIT_CREDIT_CODE)= 15 or lengthb(ibjui.USE_UNIT_CREDIT_CODE)= 18)
<if test="unitCodes !=null and unitCodes.size>0">
and ibjui.USE_UNIT_CREDIT_CODE in
<foreach collection="unitCodes" separator="," item="unitCode" open="(" close=")">
#{unitCode}
</foreach>
</if>
<if test="orgBranchCodes !=null and orgBranchCodes.size>0">
and ibjsi.ORG_BRANCH_CODE in
<foreach collection="orgBranchCodes" separator="," item="orgBranchCode" open="(" close=")">
#{orgBranchCode}
</foreach>
</if>
GROUP BY use_code,supervise_org_code
</select>
<select id="getCategoryData" resultType="java.util.Map">
SELECT
(SELECT
to_json ( b ) :: json
FROM
(SELECT
ifnull ( SUM ( int4 ( ( elevator :: json -> 'waitClaim' ) ) ), 0 ) waitClaim,
ifnull ( SUM ( int4 ( ( elevator :: json -> 'alreadyClaim' ) ) ), 0 ) alreadyClaim,
ifnull ( SUM ( int4 ( ( elevator :: json -> 'refuseClaim' ) ) ), 0 ) refuseClaim
FROM
biz_jg_equipment_category_data bjecd
WHERE
<if test="level == 'company'">
bjecd."unit_code" = #{companyCode}
</if>
<if test="level != 'company'">
bjecd."org_branch_code" LIKE CONCAT('%',#{orgCode},'%')
</if>
) b
) elevator,
(SELECT
to_json ( b ) :: json
FROM
(SELECT
ifnull ( SUM ( int4 ( ( vehicle :: json -> 'waitClaim' ) ) ), 0 ) waitClaim,
ifnull ( SUM ( int4 ( ( vehicle :: json -> 'alreadyClaim' ) ) ), 0 ) alreadyClaim,
ifnull ( SUM ( int4 ( ( vehicle :: json -> 'refuseClaim' ) ) ), 0 ) refuseClaim
FROM
biz_jg_equipment_category_data bjecd
WHERE
<if test="level == 'company'">
bjecd."unit_code" = #{companyCode}
</if>
<if test="level != 'company'">
bjecd."org_branch_code" LIKE CONCAT('%',#{orgCode},'%')
</if>
) b
) vehicle,
(SELECT
to_json ( b ) :: json
FROM
(SELECT
ifnull ( SUM ( int4 ( ( ropeway :: json -> 'waitClaim' ) ) ), 0 ) waitClaim,
ifnull ( SUM ( int4 ( ( ropeway :: json -> 'alreadyClaim' ) ) ), 0 ) alreadyClaim,
ifnull ( SUM ( int4 ( ( ropeway :: json -> 'refuseClaim' ) ) ), 0 ) refuseClaim
FROM
biz_jg_equipment_category_data bjecd
WHERE
<if test="level == 'company'">
bjecd."unit_code" = #{companyCode}
</if>
<if test="level != 'company'">
bjecd."org_branch_code" LIKE CONCAT('%',#{orgCode},'%')
</if>
) b
) ropeway,
(SELECT
to_json ( b ) :: json
FROM
(SELECT
ifnull ( SUM ( int4 ( ( rides :: json -> 'waitClaim' ) ) ), 0 ) waitClaim,
ifnull ( SUM ( int4 ( ( rides :: json -> 'alreadyClaim' ) ) ), 0 ) alreadyClaim,
ifnull ( SUM ( int4 ( ( rides :: json -> 'refuseClaim' ) ) ), 0 ) refuseClaim
FROM
biz_jg_equipment_category_data bjecd
WHERE
<if test="level == 'company'">
bjecd."unit_code" = #{companyCode}
</if>
<if test="level != 'company'">
bjecd."org_branch_code" LIKE CONCAT('%',#{orgCode},'%')
</if>
) b
) rides,
(SELECT
to_json ( b ) :: json
FROM
(SELECT
ifnull ( SUM ( int4 ( ( boiler :: json -> 'waitClaim' ) ) ), 0 ) waitClaim,
ifnull ( SUM ( int4 ( ( boiler :: json -> 'alreadyClaim' ) ) ), 0 ) alreadyClaim,
ifnull ( SUM ( int4 ( ( boiler :: json -> 'refuseClaim' ) ) ), 0 ) refuseClaim
FROM
biz_jg_equipment_category_data bjecd
WHERE
<if test="level == 'company'">
bjecd."unit_code" = #{companyCode}
</if>
<if test="level != 'company'">
bjecd."org_branch_code" LIKE CONCAT('%',#{orgCode},'%')
</if>
) b
) boiler,
(SELECT
to_json ( b ) :: json
FROM
(SELECT
ifnull ( SUM ( int4 ( ( vessel :: json -> 'waitClaim' ) ) ), 0 ) waitClaim,
ifnull ( SUM ( int4 ( ( vessel :: json -> 'alreadyClaim' ) ) ), 0 ) alreadyClaim,
ifnull ( SUM ( int4 ( ( vessel :: json -> 'refuseClaim' ) ) ), 0 ) refuseClaim
FROM
biz_jg_equipment_category_data bjecd
WHERE
<if test="level == 'company'">
bjecd."unit_code" = #{companyCode}
</if>
<if test="level != 'company'">
bjecd."org_branch_code" LIKE CONCAT('%',#{orgCode},'%')
</if>
) b
) vessel,
(SELECT
to_json ( b ) :: json
FROM
(SELECT
ifnull ( SUM ( int4 ( ( pipeline :: json -> 'waitClaim' ) ) ), 0 ) waitClaim,
ifnull ( SUM ( int4 ( ( pipeline :: json -> 'alreadyClaim' ) ) ), 0 ) alreadyClaim,
ifnull ( SUM ( int4 ( ( pipeline :: json -> 'refuseClaim' ) ) ), 0 ) refuseClaim
FROM
biz_jg_equipment_category_data bjecd
WHERE
<if test="level == 'company'">
bjecd."unit_code" = #{companyCode}
</if>
<if test="level != 'company'">
bjecd."org_branch_code" LIKE CONCAT('%',#{orgCode},'%')
</if>
) b
) pipeline,
(SELECT
to_json ( b ) :: json
FROM
(SELECT
ifnull ( SUM ( int4 ( ( lifting :: json -> 'waitClaim' ) ) ), 0 ) waitClaim,
ifnull ( SUM ( int4 ( ( lifting :: json -> 'alreadyClaim' ) ) ), 0 ) alreadyClaim,
ifnull ( SUM ( int4 ( ( lifting :: json -> 'refuseClaim' ) ) ), 0 ) refuseClaim
FROM
biz_jg_equipment_category_data bjecd
WHERE
<if test="level == 'company'">
bjecd."unit_code" = #{companyCode}
</if>
<if test="level != 'company'">
bjecd."org_branch_code" LIKE CONCAT('%',#{orgCode},'%')
</if>
) b
) lifting
</select>
<select id="getUnitCodeByRecord" resultType="java.lang.String">
select "USE_UNIT_CREDIT_CODE" from idx_biz_jg_use_info where "RECORD" = #{id}
</select>
<select id="useUnitCreditCodeCategoryCount" resultType="com.yeejoin.amos.boot.module.flc.api.dto.UseUnitCreditCodeCategoryDto">
SELECT
ibjsi."ORG_BRANCH_CODE",
ibjui."USE_UNIT_CREDIT_CODE",
ibjoi."CLAIM_STATUS",
ibjri."EQU_LIST",
COUNT ( * ) as TOTAL
FROM
idx_biz_jg_use_info ibjui
LEFT JOIN idx_biz_jg_register_info ibjri ON ibjui.RECORD = ibjri.RECORD
LEFT JOIN idx_biz_jg_other_info ibjoi ON ibjui.RECORD = ibjoi.RECORD
LEFT JOIN idx_biz_jg_supervision_info ibjsi ON ibjsi."RECORD" = ibjui."RECORD"
where
ibjoi."CLAIM_STATUS" <![CDATA[ <> ]]> ''
and ibjui."USE_UNIT_CREDIT_CODE" <![CDATA[ <> ]]> ''
and ibjri."EQU_LIST" <![CDATA[ <> ]]> ''
GROUP BY ibjui."USE_UNIT_CREDIT_CODE",ibjsi."ORG_BRANCH_CODE", ibjoi."CLAIM_STATUS",ibjri."EQU_LIST"
</select>
<select id="getEquipExportData" resultType="com.yeejoin.amos.boot.module.tzs.api.vo.EquipExportVo">
select ORG_BRANCH_NAME as orgBranchName,
USE_UNIT_NAME as useUnitName,
EQU_LIST as equList,
EQU_CATEGORY as equCategory,
USE_ORG_CODE as useOrgCode,
CODE96333 as code96333,
SUPERVISORY_CODE as supervisoryCode,
USE_PLACE as usePlace,
EQU_CODE as equCode,
CASE when EQU_STATE = 0 then '未登记'
when EQU_STATE = 1 then '在用'
when EQU_STATE = 2 then '停用'
when EQU_STATE = 3 then '报废'
when EQU_STATE = 4 then '注销'
ELSE EQU_STATE
END as equState
from ${dto.tableName}
<where>
<if test="dto.CODE96333 != '' and dto.CODE96333 != null">CODE96333 like concat('%', #{dto.CODE96333},'%')</if>
<if test="dto.EQU_CODE != '' and dto.EQU_CODE != null">and EQU_CODE like concat('%', #{dto.EQU_CODE},'%')</if>
<if test="dto.SUPERVISORY_CODE != '' and dto.SUPERVISORY_CODE != null">and SUPERVISORY_CODE like concat('%', #{dto.SUPERVISORY_CODE},'%')</if>
<if test="dto.USE_UNIT_NAME != '' and dto.USE_UNIT_NAME != null">and USE_UNIT_NAME like concat('%', #{dto.USE_UNIT_NAME},'%')</if>
<if test="dto.USE_ORG_CODE != '' and dto.USE_ORG_CODE != null">and USE_ORG_CODE like concat('%', #{dto.USE_ORG_CODE},'%')</if>
<if test="dto.EQU_LIST_CODE != '' and dto.EQU_LIST_CODE != null">and EQU_LIST_CODE = #{dto.EQU_LIST_CODE}</if>
<if test="dto.EQU_STATE != '' and dto.EQU_STATE != null">and EQU_STATE = #{dto.EQU_STATE}</if>
<if test="dto.ORG_BRANCH_NAME != '' and dto.ORG_BRANCH_NAME != null">and ORG_BRANCH_NAME = #{dto.ORG_BRANCH_NAME}</if>
<if test="dto.USE_PLACE != '' and dto.USE_PLACE != null">and USE_PLACE = #{dto.USE_PLACE}</if>
<if test="dto.STATUS != '' and dto.STATUS != null">and STATUS = #{dto.STATUS}</if>
<if test="dto.EQU_CATEGORY != '' and dto.EQU_CATEGORY != null">and EQU_CATEGORY = #{dto.EQU_CATEGORY}</if>
<if test="dto.USE_UNIT_CREDIT_CODE != '' and dto.USE_UNIT_CREDIT_CODE != null">and USE_UNIT_CREDIT_CODE like concat('%', #{dto.USE_UNIT_CREDIT_CODE},'%')</if>
<if test="dto.ORG_BRANCH_CODE != '' and dto.ORG_BRANCH_CODE != null">and ORG_BRANCH_CODE like concat('%', #{dto.ORG_BRANCH_CODE},'%')</if>
<if test='dto.ids != null'> and SEQUENCE_NBR in
<foreach collection="dto.ids" item="id" open="(" close=")" separator=",">
#{id}
</foreach>
</if>
</where>
</select>
</mapper>
<?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.yeejoin.amos.boot.module.flc.api.mapper.EquipmentIndexInformMapper">
</mapper>
<?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.yeejoin.amos.boot.module.flc.api.mapper.EquipmentIndexMapper">
</mapper>
<?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.yeejoin.amos.boot.module.flc.api.mapper.EquipmentInformMapper">
<select id="queryDtoList" resultType="java.util.Map">
SELECT
a.sequence_nbr AS sequenceNbr,
a.product_code AS productCode,
a.product_unit AS productUnit,
CONCAT(a.province,a.city,a.district) AS productArea,
CONCAT(a.stree,a.community,a.address) AS address,
a.plan_product_date AS planProductDate,
a.product_inform_date AS productInformDate,
a.accept_unit AS acceptUnit,
CASE
a.inform_status
WHEN 0 THEN
'暂存'
WHEN 1 THEN
'未接收'
WHEN 2 THEN
'已接收'
WHEN 9 THEN
'已驳回'
ELSE
''
END AS informStatus,
IFNULL(t.equipmentNum, 0) as equipmentNum,
a.process_id AS processId
FROM
tz_equipment_inform a
LEFT JOIN (select count(e.sequence_nbr) as equipmentNum, e.inform_id from tcb_inform_equipment e GROUP BY e.inform_id ) t on t.inform_id = a.sequence_nbr
WHERE a.is_delete = 0
AND a.product_unit_id = #{companyId}
<if test="productCode != null and productCode != ''">
AND a.product_code like CONCAT('%',#{productCode},'%')
</if>
<if test="productUnitId != null ">
AND a.product_unit_id = #{productUnitId}
</if>
<if test="regionCode != null and regionCode != ''">
AND a.region_code like CONCAT('%',#{regionCode},'%')
</if>
<if test="address != null and address != ''">
AND ( a.stree like CONCAT('%',#{address},'%')
or a.community like CONCAT('%',#{address},'%')
or a.address like CONCAT('%',#{address},'%') )
</if>
<if test="productInformDateStart != null and productInformDateStart != ''">
and #{productInformDateStart} <![CDATA[ <= ]]> a.product_inform_date
</if>
<if test="productInformDateEnd != null and productInformDateEnd != ''">
and a.product_inform_date <![CDATA[ <= ]]> #{productInformDateEnd}
</if>
<if test="planProductDateStart != null and planProductDateStart != ''">
and #{planProductDateStart} <![CDATA[ <= ]]> a.plan_product_date
</if>
<if test="planProductDateEnd != null and planProductDateEnd != ''">
and a.plan_product_date <![CDATA[ <= ]]> #{planProductDateEnd}
</if>
<if test="acceptUnitId != null ">
AND a.accept_unit_id = #{acceptUnitId}
</if>
<if test="informStatus != null and informStatus != ''">
AND a.inform_status = #{informStatus}
</if>
<if test="sortParam != null and sortParam != '' and sortRule != null and sortRule != '' ">
ORDER BY ${sortParam} ${sortRule}
</if>
</select>
<select id="queryDtoListSub" resultType="java.util.Map">
SELECT
a.sequence_nbr AS sequenceNbr,
a.product_code AS productCode,
a.product_unit AS productUnit,
CONCAT(a.province,a.city,a.district) AS productArea,
CONCAT(a.stree,a.community,a.address) AS address,
a.plan_product_date AS planProductDate,
a.product_inform_date AS productInformDate,
a.accept_unit AS acceptUnit,
CASE
a.inform_status
WHEN 0 THEN
'暂存'
WHEN 1 THEN
'未接收'
WHEN 2 THEN
'已接收'
WHEN 9 THEN
'已驳回'
ELSE
''
END AS informStatus,
IFNULL(t.equipmentNum, 0) as equipmentNum,
a.process_id AS processId
FROM
tz_equipment_inform a
LEFT JOIN (select count(e.sequence_nbr) as equipmentNum, e.inform_id from tcb_inform_equipment e GROUP BY e.inform_id ) t on t.inform_id = a.sequence_nbr
WHERE a.is_delete = 0
AND a.accept_unit_id = #{companyId}
AND a.inform_status != 0
<if test="productCode != null and productCode != ''">
AND a.product_code like CONCAT('%',#{productCode},'%')
</if>
<if test="productUnitId != null ">
AND a.product_unit_id = #{productUnitId}
</if>
<if test="regionCode != null and regionCode != ''">
AND a.region_code like CONCAT('%',#{regionCode},'%')
</if>
<if test="address != null and address != ''">
AND ( a.stree like CONCAT('%',#{address},'%')
or a.community like CONCAT('%',#{address},'%')
or a.address like CONCAT('%',#{address},'%') )
</if>
<if test="productInformDateStart != null and productInformDateStart != ''">
and #{productInformDateStart} <![CDATA[ <= ]]> a.product_inform_date
</if>
<if test="productInformDateEnd != null and productInformDateEnd != ''">
and a.product_inform_date <![CDATA[ <= ]]> #{productInformDateEnd}
</if>
<if test="planProductDateStart != null and planProductDateStart != ''">
and #{planProductDateStart} <![CDATA[ <= ]]> a.plan_product_date
</if>
<if test="planProductDateEnd != null and planProductDateEnd != ''">
and a.plan_product_date <![CDATA[ <= ]]> #{planProductDateEnd}
</if>
<if test="acceptUnitId != null ">
AND a.accept_unit_id = #{acceptUnitId}
</if>
<if test="informStatus != null and informStatus != ''">
AND a.inform_status = #{informStatus}
</if>
<if test="sortParam != null and sortParam != '' and sortRule != null and sortRule != '' ">
ORDER BY ${sortParam} ${sortRule}
</if>
</select>
</mapper>
<?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.yeejoin.amos.boot.module.flc.api.mapper.EquipmentMapper">
</mapper>
<?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.yeejoin.amos.boot.module.flc.api.mapper.InformEquipmentMapper">
</mapper>
<?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.yeejoin.amos.boot.module.flc.api.mapper.InformProcessInfoMapper">
</mapper>
<?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.yeejoin.amos.boot.module.flc.api.mapper.PersonEducationMapper">
</mapper>
<?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.yeejoin.amos.boot.module.flc.api.mapper.PersonQualityMapper">
</mapper>
<?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.yeejoin.amos.boot.module.flc.api.mapper.RegUnitIcMapper">
</mapper>
<?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.yeejoin.amos.boot.module.flc.api.mapper.RegUnitInfoMapper">
<select id="userData" resultType="com.yeejoin.amos.boot.module.flc.api.entity.RegUnitInfo">
SELECT
sequence_nbr,
name,
unit_code,
unit_code_type,
unit_type,
unit_type_code,
management_unit,
management_unit_id,
region_code,
country,
province,
city,
district,
stree,
community,
address,
longitude,
latitude,
industry_name,
legal_person,
legal_person_tel,
contact_person,
contact_person_tel,
admin_name,
admin_login_name,
admin_login_pwd,
admin_tel,
admin_id_number,
state,
admin_user_id,
amos_company_seq,
rec_user_id,
rec_user_name,
rec_date,
is_delete,
unit_code_type_name,
admin_id_card_photo
FROM tz_flc_reg_unit_info WHERE admin_tel=#{phone}
</select>
<select id="userDataINfo" resultType="com.yeejoin.amos.boot.module.flc.api.entity.RegUnitInfo">
SELECT
sequence_nbr,
name,
unit_code,
unit_code_type,
unit_type,
unit_type_code,
management_unit,
management_unit_id,
region_code,
country,
province,
city,
district,
stree,
community,
address,
longitude,
latitude,
industry_name,
legal_person,
legal_person_tel,
contact_person,
contact_person_tel,
admin_name,
admin_tel,
admin_id_number,
amos_company_seq,
unit_code_type_name,
admin_id_card_photo
FROM tz_flc_reg_unit_info WHERE admin_login_name=#{adminLoginName}
OR admin_tel=#{adminLoginName}
AND admin_login_pwd=#{adminLoginPwd}
</select>
<select id="userIdINfo" resultType="com.yeejoin.amos.boot.module.flc.api.entity.RegUnitInfo">
SELECT
sequence_nbr,
name,
unit_code,
unit_code_type,
unit_type,
unit_type_code,
management_unit,
management_unit_id,
region_code,
country,
province,
city,
district,
stree,
community,
address,
longitude,
latitude,
industry_name,
legal_person,
legal_person_tel,
contact_person,
contact_person_tel,
admin_name,
admin_tel,
admin_id_number,
amos_company_seq,
unit_code_type_name,
admin_id_card_photo
FROM tz_flc_reg_unit_info WHERE
admin_user_id=#{userId}
</select>
</mapper>
<?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.yeejoin.amos.boot.module.flc.api.mapper.TaskMapper">
</mapper>
<?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.yeejoin.amos.boot.module.tzs.api.mapper.UnitInfoApproveMapper">
</mapper>
<?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.yeejoin.amos.boot.module.tzs.api.mapper.UnitInfoChangeMapper">
</mapper>
<?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.yeejoin.amos.boot.module.flc.api.mapper.UnitInfoMapper">
<select id="getUnitByType" resultType="com.yeejoin.amos.boot.module.flc.api.dto.UnitInfoDto">
select
a.*
from tz_flc_unit_info a
where a.is_delete = 0 AND
(a.unit_status = '1' or a.is_change = 1)
AND a.unit_type_code LIKE CONCAT('%', #{typeCode}, '%')
</select>
<select id="getAllUnit" resultType="com.yeejoin.amos.boot.module.flc.api.dto.UnitInfoDto">
select
a.*
from tz_flc_unit_info a
where a.is_delete = 0
AND
(a.unit_status = '1' or a.is_change = 1)
</select>
<select id="getUnitByTypeParams" resultType="com.yeejoin.amos.boot.module.flc.api.dto.UnitInfoDto">
select
a.*,
CONCAT(a.province, a.city, a.district ,a.stree,a.community,a.address ) as fullAddress
from tz_flc_unit_info a
where a.is_delete = 0 AND
(a.unit_status = '1' or a.is_change = 1)
AND a.unit_type_code LIKE CONCAT('%', #{typeCode}, '%')
<if test="unitType != null and unitType != ''">
AND a.unit_type LIKE CONCAT('%', #{unitType}, '%')
</if>
<if test="address != null and address != ''">
AND ( a.province LIKE CONCAT('%', #{address}, '%')
OR a.city LIKE CONCAT('%', #{address}, '%')
OR a.district LIKE CONCAT('%', #{address}, '%')
OR a.stree LIKE CONCAT('%', #{address}, '%')
OR a.community LIKE CONCAT('%', #{address}, '%')
OR a.address LIKE CONCAT('%', #{address}, '%')
)
</if>
<if test="orgName != null and orgName != ''">
AND a.org_name LIKE CONCAT('%', #{orgName}, '%')
</if>
<if test="organizationCode != null and organizationCode != ''">
AND a.organization_code LIKE CONCAT('%', #{organizationCode}, '%')
</if>
</select>
<select id="getUnitWithoutQrcode" resultType="com.yeejoin.amos.boot.module.flc.api.entity.UnitInfo">
SELECT
a.*
FROM
tz_flc_unit_info a
LEFT JOIN cb_source_file f on f.source_id = a.sequence_nbr and f.file_category = 'qrCode'
WHERE
a.is_delete = 0
AND (
a.unit_status = '1'
OR a.is_change = 1)
and f.sequence_nbr is null
</select>
</mapper>
<?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.yeejoin.amos.boot.module.flc.api.mapper.UnitPersonMapper">
<select id="selectPersonListCount" resultType="Integer">
select count(1) from (
SELECT
DISTINCT
u.sequence_nbr AS sequenceNbr,
u.*,
replace(CONCAT(u.org_expand_attr6->'$.province',u.org_expand_attr6->'$.city',u.org_expand_attr6->'$.district',u.org_expand_attr6->'$.address'),'"','') fulladdress ,
g.*,
p.biz_org_name as parentName,
TIMESTAMPDIFF(YEAR, g.birthday, CURDATE()) as ages ,
case
when count(q.sequence_nbr) > 0 then '有'
else '无' end hasLicence
FROM
cb_org_usr u
LEFT JOIN
( SELECT
v.`instance_id`,
max(case v.field_code when 'person_type' then IFNULL(v.field_value_label,v.field_value) end) person_type,
max(case v.field_code when 'sex' then IFNULL(v.field_value_label,v.field_value) end) sex,
max(case v.field_code when 'birthday' then IFNULL(v.field_value_label,v.field_value) end) birthday,
max(case v.field_code when 'licence_type' then IFNULL(v.field_value_label,v.field_value) end) licence_type,
max(case v.field_code when 'licence_code' then IFNULL(v.field_value_label,v.field_value) end) licence_code,
max(case v.field_code when 'education' then IFNULL(v.field_value_label,v.field_value) end) education,
max(case v.field_code when 'major' then IFNULL(v.field_value_label,v.field_value) end) major,
max(case v.field_code when 'phone' then IFNULL(v.field_value_label,v.field_value) end) phone,
max(case v.field_code when 'email' then IFNULL(v.field_value_label,v.field_value) end) email
FROM
`cb_dynamic_form_instance` v
WHERE
v.group_code = 1106
GROUP BY
v.`instance_id`
) g
on u.sequence_nbr = g.instance_id
LEFT JOIN tz_flc_person_quality q on q.pserson_id = u.sequence_nbr
LEFT JOIN cb_org_usr p on p.sequence_nbr = u.parent_id
where
u.biz_org_type = 'person'
AND
u.is_delete = 0
<if test="map.parentId != null">
AND u.parent_id in
<foreach collection="map.parentId" item="item" open="(" close=")" separator=","> ${item} </foreach>
</if>
GROUP BY
u.sequence_nbr ,
u.biz_org_name ,
u.biz_org_code
order by u.rec_date desc
)a where a.sequence_nbr is not null
<if test="map.ages != null">
<choose>
<when test="map.ages == 0">
AND a.ages <![CDATA[ >= ]]> 60
</when>
<when test="map.ages == 1">
AND a.ages <![CDATA[ <= ]]> 59 and a.ages <![CDATA[ >= ]]> 50
</when>
<when test="map.ages == 2">
AND a.ages <![CDATA[ <= ]]> 49 and a.ages <![CDATA[ >= ]]> 40
</when>
<when test="map.ages == 3">
AND a.ages <![CDATA[ <= ]]> 39 and a.ages <![CDATA[ >= ]]> 30
</when>
<when test="map.ages == 4">
AND a.ages <![CDATA[ <= ]]> 29 and a.ages <![CDATA[ >= ]]> 20
</when>
<when test="map.ages == 5">
AND a.ages <![CDATA[ < ]]> 20
</when>
</choose>
</if>
<if test="map.sql != null">
<foreach collection="map.sql" item="item"> ${item} </foreach>
</if>
</select>
<select id="selectPersonList" resultType="Map">
select * from (
SELECT
DISTINCT
u.sequence_nbr AS sequenceNbr,
u.*,
replace(CONCAT(u.org_expand_attr6->'$.province',u.org_expand_attr6->'$.city',u.org_expand_attr6->'$.district',u.org_expand_attr6->'$.address'),'"','') fulladdress ,
g.*,
p.biz_org_name as parentName,
TIMESTAMPDIFF(YEAR, g.birthday, CURDATE()) as ages ,
case
when count(q.sequence_nbr) > 0 then '有'
else '无' end hasLicence
FROM
cb_org_usr u
LEFT JOIN
( SELECT
v.`instance_id`,
max(case v.field_code when 'person_type' then IFNULL(v.field_value_label,v.field_value) end) person_type,
max(case v.field_code when 'sex' then IFNULL(v.field_value_label,v.field_value) end) sex,
max(case v.field_code when 'birthday' then IFNULL(v.field_value_label,v.field_value) end) birthday,
max(case v.field_code when 'licence_type' then IFNULL(v.field_value_label,v.field_value) end) licence_type,
max(case v.field_code when 'licence_code' then IFNULL(v.field_value_label,v.field_value) end) licence_code,
max(case v.field_code when 'education' then IFNULL(v.field_value_label,v.field_value) end) education,
max(case v.field_code when 'major' then IFNULL(v.field_value_label,v.field_value) end) major,
max(case v.field_code when 'phone' then IFNULL(v.field_value_label,v.field_value) end) phone,
max(case v.field_code when 'email' then IFNULL(v.field_value_label,v.field_value) end) email
FROM
`cb_dynamic_form_instance` v
WHERE
v.group_code = 1106
GROUP BY
v.`instance_id`
) g
on u.sequence_nbr = g.instance_id
LEFT JOIN tz_flc_person_quality q on q.pserson_id = u.sequence_nbr
LEFT JOIN cb_org_usr p on p.sequence_nbr = u.parent_id
where
u.biz_org_type = 'person'
AND
u.is_delete = 0
<if test="map.parentId != null">
AND u.parent_id in
<foreach collection="map.parentId" item="item" open="(" close=")" separator=","> ${item} </foreach>
</if>
GROUP BY
u.sequence_nbr ,
u.biz_org_name ,
u.biz_org_code
order by u.rec_date desc
)a where a.sequence_nbr is not null
<if test="map.ages != null">
<choose>
<when test="map.ages == 0">
AND a.ages <![CDATA[ >= ]]> 60
</when>
<when test="map.ages == 1">
AND a.ages <![CDATA[ <= ]]> 59 and a.ages <![CDATA[ >= ]]> 50
</when>
<when test="map.ages == 2">
AND a.ages <![CDATA[ <= ]]> 49 and a.ages <![CDATA[ >= ]]> 40
</when>
<when test="map.ages == 3">
AND a.ages <![CDATA[ <= ]]> 39 and a.ages <![CDATA[ >= ]]> 30
</when>
<when test="map.ages == 4">
AND a.ages <![CDATA[ <= ]]> 29 and a.ages <![CDATA[ >= ]]> 20
</when>
<when test="map.ages == 5">
AND a.ages <![CDATA[ < ]]> 20
</when>
</choose>
</if>
<if test="map.sql != null">
<foreach collection="map.sql" item="item"> ${item} </foreach>
</if>
LIMIT #{map.pageNum}, #{map.pageSize}
</select>
</mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment