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.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.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.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.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.flc.api.entity.EquipmentAssociated; 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.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.flc.api.entity.EquipmentIndexInform; 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.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.flc.api.entity.EquipmentIndex; import com.yeejoin.amos.boot.module.flc.api.entity.EquipmentIndex;
import com.yeejoin.amos.boot.module.tzs.flc.api.entity.EquipmentIndex;
/** /**
* 设备指标 Mapper 接口 * 设备指标 Mapper 接口
......
...@@ -2,7 +2,6 @@ package com.yeejoin.amos.boot.module.flc.api.mapper; ...@@ -2,7 +2,6 @@ package com.yeejoin.amos.boot.module.flc.api.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.flc.api.entity.PersonQuality; import com.yeejoin.amos.boot.module.flc.api.entity.PersonQuality;
import com.yeejoin.amos.boot.module.tzs.flc.api.entity.PersonQuality;
/** /**
* 企业人员资质信息表 Mapper 接口 * 企业人员资质信息表 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.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