123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506 |
- <?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.bootdo.datas.dao.GyDataDao">
- <sql id="selectSql">
- b.ID as id,
- a.REPORTER_UNIT as reporterUnit,
- a.CREDIT_CODE as creditCode,
- a.UNIT_CHARACTER as unitCharacter,
- a.INDUSTRY_TYPE_ONE as industryTypeOne,
- a.INDUSTRY_TYPE_TWO as industryTypeTwo,
- a.UNIT_PROVINCE as unitProvince,
- a.UNIT_CITY as unitCity,
- a.SUPERVISORY_ORG as supervisoryOrg,
- a.UNIT_MAN as unitMan,
- a.UNIT_OFFICE as unitOffice,
- a.DATA_SECURITY_MAN as dataSecurityMan,
- a.DATA_SECURITY_OFFICE as dataSecurityOffice,
- a.DATA_SECURITY_WAY as dataSecurityWay,
- b.DATA_NAME as dataName,
- b.DATA_TYPE_BASE as dataTypeBase,
- b.DATA_TYPE_ROOT as dataTypeROOT,
- b.DATA_TYPE_ONE as dataTypeOne,
- b.DATA_TYPE_TWO as dataTypeTwo,
- b.DATA_TYPE_THREE as dataTypeThree,
- b.DATA_TYPE_FOUR as dataTypeFour,
- b.DATA_LEVEL as dataLevel,
- b.DATA_CARRIER as dataCarrier,
- b.DATA_SOURCE as dataSource,
- b.DATA_NUM as dataNum,
- b.DATA_NUM_GB as dataNumGb,
- b.DATA_SCOPE as dataScope,
- b.DATA_PROPORTION as dataProportion,
- b.DATA_PRECISION as dataPrecision,
- b.DATA_PRECISION_DES as dataPrecisionDes,
- b.DATA_HANDLE_TYPE as dataHandleType,
- b.DATA_RESULT as dataResult,
- b.IS_ALGORITHM_HANDLE as isAlgorithmHandle,
- b.IS_CROSS as isCross,
- b.CROSS_ACCEPT_NAME as crossAcceptName,
- b.DATA_CROSS_RESULT as dataCrossResult,
- b.DATA_CROSS_TYPE as dataCrossType,
- b.IS_SECURITY_ASS as isSecurityAss,
- b.ASSESS_RESULT as assessResult,
- b.IS_CROSS_MAIN as isCrossMain,
- b.CROSSMAIN_ACCEPT_NAME as crossmainAcceptName,
- b.DATA_CROSSMAIN_RESULT as dataCrossmainResult,
- b.DATA_CROSSMAIN_TYPE as dataCrossmainType,
- b.IS_CROSSMAIN_FLOW as isCrossmainFlow,
- b.IS_FOREIGN_DATA as isForeignData,
- b.INFO_SYSTEM_NAME as infoSystemName,
- b.INFO_SYSTEM_TYPE as infoSystemType,
- b.INFO_SYSTEM_IPADDRESS as infoSystemIpAddress,
- b.INFO_SYSTEM_DOMAINNAME as infoSystemDomainName,
- b.SECURITY_COGNIZANCE as securityCognizance,
- b.COM_SECURITY_COGNIZANCE as comSecurityCognizance,
- b.IS_KET_SYSTEM as isKetSystem,
- b.IS_KEYDATA_ASS as isKeydataAss,
- b.ASSESS_ORG as assessOrg,
- b.ASSESS_BASE as assessBase,
- b.ASSESS_TIME as assessTime,
- b.DATA_ASSESS_RESULT as dataAssessResult,
- b.DATA_STATUS as dataStatus,
- b.UPLOAD_TIME as uploadTime,
- b.UPDATE_TIME as updateTime,
- b.GY_NUIT_ID as gyUnitId,
- b.ROLE_ID as roleId,
- b.next_verify_dept as nextVerifyDept,
- b.SEND_VERIFY as sendVerify,
- b.DELETE_STATUS as deleteStatus,
- b.DATA_DESC as dataDesc,
- b.AUDIT_STAGE as auditStage
- </sql>
- <select id="get" resultType="com.bootdo.datas.dto.GyDataImportDTO">
- select
- <include refid="selectSql"/>
- FROM gy_unit a,gy_data b
- where b.ID = #{value} and
- a.CREDIT_CODE = b.GY_NUIT_ID
- </select>
- <select id="getRecoverData" resultType="com.bootdo.datas.dto.GyDataImportDTO">
- SELECT
- b.ID as id,
- b.DATA_NAME as dataName,
- b.GY_NUIT_ID as gyUnitId,
- b.DATA_STATUS as dataStatus,
- b.DELETE_STATUS as deleteStatus
- FROM gy_data b where b.ID = #{value}
- </select>
- <select id="getDataExcel" resultType="com.bootdo.datas.domain.GyDataExcelDO">
- select
- <include refid="selectSql"/>
- FROM gy_unit a,gy_data b
- where b.ID = #{value} and
- a.CREDIT_CODE = b.GY_NUIT_ID
- </select>
- <select id="getGbDataExcel" resultType="com.bootdo.datas.domain.GbDataExcelDO">
- select
- <include refid="selectSql"/>
- FROM gy_unit a,gy_data b
- where b.ID = #{value} and
- a.CREDIT_CODE = b.GY_NUIT_ID
- </select>
- <select id="listId" resultType="com.bootdo.datas.dto.GyDataImportDTO">
- SELECT
- b.ID as id,b.DATA_STATUS as dataStatus
- FROM gy_data b
- <where>
- b.DELETE_STATUS = '0'
- and b.DATA_NAME = #{dataName}
- and b.GY_NUIT_ID = #{gyUnitId}
- </where>
- </select>
- <select id="list" resultType="com.bootdo.datas.dto.GyDataImportDTO">
- SELECT
- <include refid="selectSql"/>
- FROM gy_unit a,gy_data b
- <where>
- a.CREDIT_CODE = b.GY_NUIT_ID
- AND b.DELETE_STATUS = '0'
- <if test="neqDataStatus != null and neqDataStatus != ''"> and b.DATA_STATUS != #{neqDataStatus}</if>
- <if test="industryTypeOne != null and industryTypeOne != ''"> and a.INDUSTRY_TYPE_ONE like CONCAT('%',#{industryTypeOne},'%')</if>
- <if test="dataName != null and dataName != ''"> and b.DATA_NAME like CONCAT('%',#{dataName},'%')</if>
- <if test="dataLevel != null and dataLevel != ''"> and b.DATA_LEVEL = #{dataLevel}</if>
- <if test="reporterUnit != null and reporterUnit != ''"> and a.REPORTER_UNIT like
- CONCAT('%',#{reporterUnit},'%')
- </if>
- <if test="nextVerifyDept != null and nextVerifyDept != ''"> and b.next_verify_dept = #{nextVerifyDept}</if>
- <if test="unitCity != null and unitCity != ''"> and a.UNIT_CITY = #{unitCity}</if>
- <if test="unitId != null and unitId != ''"> and a.CREDIT_CODE = #{unitId}</if>
- <if test="creditCode != null and creditCode != ''"> and a.CREDIT_CODE = #{creditCode}</if>
- <if test="gyUnitId != null and gyUnitId != ''"> and b.GY_NUIT_ID = #{gyUnitId}</if>
- <choose>
- <when test="unitProvince != null and unitProvince.trim() != '' and roleId != null and roleId.trim() != ''">
- and (a.UNIT_PROVINCE = #{unitProvince} or b.role_id = #{roleId})
- </when>
- <when test="unitProvince != null and unitProvince.trim() != ''">
- and a.UNIT_PROVINCE = #{unitProvince}
- </when>
- <when test="roleId != null and roleId.trim() != ''">
- and b.role_id = #{roleId}
- </when>
- </choose>
- <if test="dataStatusArrs != null and dataStatusArrs.size > 0"> and b.DATA_STATUS in
- <foreach item="id" collection="dataStatusArrs" open="(" separator="," close=")">
- #{id}
- </foreach>
- </if>
- <if test="sendVerify != null and sendVerify != ''">
- and b.SEND_VERIFY = #{sendVerify}
- </if>
- <if test="auditStage != null and auditStage != ''">
- and b.AUDIT_STAGE = #{auditStage}
- </if>
- <if test="auditStageMenu != null and auditStageMenu != ''">
- and b.AUDIT_STAGE = #{auditStageMenu}
- </if>
- </where>
- <choose>
- <when test="sort != null and sort.trim() != ''">
- order by ${sort} ${order}
- </when>
- <otherwise>
- order by if(b.DATA_STATUS=3,5,b.DATA_STATUS) asc, b.UPDATE_TIME desc
- </otherwise>
- </choose>
- <if test="offset != null and limit != null">
- limit #{offset}, #{limit}
- </if>
- </select>
- <select id="countTotal" resultType="int">
- SELECT
- count(*)
- FROM gy_unit a,gy_data b
- <where>
- a.CREDIT_CODE = b.GY_NUIT_ID
- AND b.DELETE_STATUS = '0'
- <if test="neqDataStatus != null and neqDataStatus != ''"> and b.DATA_STATUS != #{neqDataStatus}</if>
- <if test="industryTypeOne != null and industryTypeOne != ''"> and a.INDUSTRY_TYPE_ONE like CONCAT('%',#{industryTypeOne},'%')</if>
- <if test="dataName != null and dataName != ''"> and b.DATA_NAME like CONCAT('%',#{dataName},'%')</if>
- <if test="dataLevel != null and dataLevel != ''"> and b.DATA_LEVEL = #{dataLevel}</if>
- <if test="reporterUnit != null and reporterUnit != ''"> and a.REPORTER_UNIT like
- CONCAT('%',#{reporterUnit},'%')
- </if>
- <if test="nextVerifyDept != null and nextVerifyDept != ''"> and b.next_verify_dept = #{nextVerifyDept}</if>
- <if test="unitCity != null and unitCity != ''"> and a.UNIT_CITY = #{unitCity}</if>
- <if test="unitId != null and unitId != ''"> and a.CREDIT_CODE = #{unitId}</if>
- <if test="creditCode != null and creditCode != ''"> and a.CREDIT_CODE = #{creditCode}</if>
- <if test="gyUnitId != null and gyUnitId != ''"> and b.GY_NUIT_ID = #{gyUnitId}</if>
- <choose>
- <when test="unitProvince != null and unitProvince.trim() != '' and roleId != null and roleId.trim() != ''">
- and (a.UNIT_PROVINCE = #{unitProvince} or b.role_id = #{roleId})
- </when>
- <when test="unitProvince != null and unitProvince.trim() != ''">
- and a.UNIT_PROVINCE = #{unitProvince}
- </when>
- <when test="roleId != null and roleId.trim() != ''">
- and b.role_id = #{roleId}
- </when>
- </choose>
- <if test="dataStatusArrs != null and dataStatusArrs.size > 0"> and b.DATA_STATUS in
- <foreach item="id" collection="dataStatusArrs" open="(" separator="," close=")">
- #{id}
- </foreach>
- </if>
- <if test="sendVerify != null and sendVerify != ''">
- and b.SEND_VERIFY = #{sendVerify}
- </if>
- <if test="auditStage != null and auditStage != ''">
- and b.AUDIT_STAGE = #{auditStage}
- </if>
- <if test="auditStageMenu != null and auditStageMenu != ''">
- and b.AUDIT_STAGE = #{auditStageMenu}
- </if>
- </where>
- </select>
- <select id="listRecover" resultType="com.bootdo.datas.dto.GyDataImportDTO">
- SELECT
- <include refid="selectSql"/>
- FROM gy_unit a,gy_data b
- <where>
- a.CREDIT_CODE = b.GY_NUIT_ID
- AND (b.DELETE_STATUS = '1'
- or b.DATA_STATUS = '4')
- <if test="industryTypeOne != null and industryTypeOne != ''"> and a.INDUSTRY_TYPE_ONE like CONCAT('%',#{industryTypeOne},'%')</if>
- <if test="dataName != null and dataName != ''">and b.DATA_NAME like CONCAT('%',#{dataName},'%')</if>
- <if test="dataLevel != null and dataLevel != ''">and b.DATA_LEVEL = #{dataLevel}</if>
- <if test="reporterUnit != null and reporterUnit != ''">and a.REPORTER_UNIT like
- CONCAT('%',#{reporterUnit},'%')
- </if>
- <if test="nextVerifyDept != null and nextVerifyDept != ''">and b.next_verify_dept = #{nextVerifyDept}</if>
- <if test="unitCity != null and unitCity != ''">and (a.UNIT_CITY = #{unitCity})</if>
- <if test="unitId != null and unitId != ''"> and a.CREDIT_CODE = #{unitId}</if>
- <if test="roleId != null and roleId != ''">and b.role_id = #{roleId}</if>
- <if test="dataStatusArrs != null and dataStatusArrs.size > 0"> and b.DATA_STATUS in
- <foreach item="id" collection="dataStatusArrs" open="(" separator="," close=")">
- #{id}
- </foreach>
- </if>
- <if test="sendVerify != null and sendVerify != ''">
- <if test="sendVerify == 0">
- and b.SEND_VERIFY = '0'
- </if>
- <if test="sendVerify == 1">
- and b.SEND_VERIFY IN('1','2')
- </if>
- <if test="sendVerify == 2">
- and b.SEND_VERIFY = '2'
- </if>
- </if>
- <if test="auditStage != null and auditStage != ''">
- and b.AUDIT_STAGE = #{auditStage}
- </if>
- </where>
- <choose>
- <when test="sort != null and sort.trim() != ''">
- order by ${sort} ${order}
- </when>
- <otherwise>
- order by b.UPDATE_TIME desc
- </otherwise>
- </choose>
- <if test="offset != null and limit != null">
- limit #{offset}, #{limit}
- </if>
- </select>
- <select id="countRecover" resultType="int">
- SELECT
- count(*)
- FROM gy_unit a,gy_data b
- <where>
- a.CREDIT_CODE = b.GY_NUIT_ID
- AND (b.DELETE_STATUS = '1'
- or b.DATA_STATUS = '4')
- <if test="industryTypeOne != null and industryTypeOne != ''"> and a.INDUSTRY_TYPE_ONE like CONCAT('%',#{industryTypeOne},'%')</if>
- <if test="dataName != null and dataName != ''">and b.DATA_NAME like CONCAT('%',#{dataName},'%')</if>
- <if test="dataLevel != null and dataLevel != ''">and b.DATA_LEVEL = #{dataLevel}</if>
- <if test="reporterUnit != null and reporterUnit != ''">and a.REPORTER_UNIT like
- CONCAT('%',#{reporterUnit},'%')
- </if>
- <if test="nextVerifyDept != null and nextVerifyDept != ''">and b.next_verify_dept = #{nextVerifyDept}</if>
- <if test="unitCity != null and unitCity != ''">and (a.UNIT_CITY = #{unitCity})</if>
- <if test="unitId != null and unitId != ''"> and a.CREDIT_CODE = #{unitId}</if>
- <if test="roleId != null and roleId != ''">and b.role_id = #{roleId}</if>
- <if test="dataStatusArrs != null and dataStatusArrs.size > 0"> and b.DATA_STATUS in
- <foreach item="id" collection="dataStatusArrs" open="(" separator="," close=")">
- #{id}
- </foreach>
- </if>
- <if test="sendVerify != null and sendVerify != ''">
- <if test="sendVerify == 0">
- and b.SEND_VERIFY = '0'
- </if>
- <if test="sendVerify == 1">
- and b.SEND_VERIFY IN('1','2')
- </if>
- <if test="sendVerify == 2">
- and b.SEND_VERIFY = '2'
- </if>
- </if>
- <if test="auditStage != null and auditStage != ''">
- and b.AUDIT_STAGE = #{auditStage}
- </if>
- </where>
- </select>
- <insert id="batchSave">
- insert into gy_data
- (
- DATA_NAME,
- DATA_TYPE_BASE,
- DATA_TYPE_ONE,
- DATA_TYPE_TWO,
- DATA_TYPE_THREE,
- DATA_TYPE_FOUR,
- DATA_LEVEL,
- DATA_CARRIER,
- DATA_SOURCE,
- DATA_NUM,
- DATA_NUM_GB,
- DATA_SCOPE,
- DATA_PROPORTION,
- DATA_PRECISION,
- DATA_PRECISION_DES,
- DATA_HANDLE_TYPE,
- DATA_RESULT,
- IS_ALGORITHM_HANDLE,
- IS_CROSS,
- CROSS_ACCEPT_NAME,
- DATA_CROSS_RESULT,
- DATA_CROSS_TYPE,
- IS_SECURITY_ASS,
- ASSESS_RESULT,
- IS_CROSS_MAIN,
- CROSSMAIN_ACCEPT_NAME,
- DATA_CROSSMAIN_RESULT,
- DATA_CROSSMAIN_TYPE,
- IS_CROSSMAIN_FLOW,
- IS_FOREIGN_DATA,
- INFO_SYSTEM_NAME,
- INFO_SYSTEM_TYPE,
- INFO_SYSTEM_IPADDRESS,
- INFO_SYSTEM_DOMAINNAME,
- SECURITY_COGNIZANCE,
- COM_SECURITY_COGNIZANCE,
- IS_KET_SYSTEM,
- IS_KEYDATA_ASS,
- ASSESS_ORG,
- ASSESS_BASE,
- ASSESS_TIME,
- DATA_ASSESS_RESULT,
- DATA_STATUS,
- UPLOAD_TIME,
- UPDATE_TIME,
- GY_NUIT_ID,
- ROLE_ID,
- next_verify_dept,
- SEND_VERIFY,
- DELETE_STATUS,
- DATA_DESC,
- AUDIT_STAGE
- )
- values
- <foreach item="item" index="index" collection="list"
- separator=",">
- (
- #{item.dataName},
- #{item.dataTypeBase},
- #{item.dataTypeOne},
- #{item.dataTypeTwo},
- #{item.dataTypeThree},
- #{item.dataTypeFour},
- #{item.dataLevel},
- #{item.dataCarrier},
- #{item.dataSource},
- #{item.dataNum},
- #{item.dataNumGb},
- #{item.dataScope},
- #{item.dataProportion},
- #{item.dataPrecision},
- #{item.dataPrecisionDes},
- #{item.dataHandleType},
- #{item.dataResult},
- #{item.isAlgorithmHandle},
- #{item.isCross},
- #{item.crossAcceptName},
- #{item.dataCrossResult},
- #{item.dataCrossType},
- #{item.isSecurityAss},
- #{item.assessResult},
- #{item.isCrossMain},
- #{item.crossmainAcceptName},
- #{item.dataCrossmainResult},
- #{item.dataCrossmainType},
- #{item.isCrossmainFlow},
- #{item.isForeignData},
- #{item.infoSystemName},
- #{item.infoSystemType},
- #{item.infoSystemIpAddress},
- #{item.infoSystemDomainName},
- #{item.securityCognizance},
- #{item.comSecurityCognizance},
- #{item.isKetSystem},
- #{item.isKeydataAss},
- #{item.assessOrg},
- #{item.assessBase},
- #{item.assessTime},
- #{item.dataAssessResult},
- #{item.dataStatus},
- #{item.uploadTime},
- #{item.updateTime},
- #{item.gyUnitId},
- #{item.roleId},
- #{item.nextVerifyDept},
- #{item.sendVerify},
- #{item.deleteStatus},
- #{item.dataDesc},
- #{item.auditStage}
- )
- </foreach>
- </insert>
- <update id="recover">
- UPDATE gy_data
- SET DELETE_STATUS = 0,
- DATA_STATUS = 0,
- SEND_VERIFY = 0,
- del_unigue_key = 0,
- AUDIT_STAGE = #{auditStage},
- UPDATE_TIME = NOW()
- WHERE
- ID = #{id}
- </update>
- <update id="updateStatus" parameterType="com.bootdo.datas.dto.GyDataImportDTO">
- update gy_data
- <set>
- <if test="auditStage != null">AUDIT_STAGE = #{auditStage},</if>
- <if test="dataStatus != null">DATA_STATUS = #{dataStatus},</if>
- <if test="sendVerify != null">SEND_VERIFY = #{sendVerify},</if>
- <if test="nextVerifyDept != null">NEXT_VERIFY_DEPT = #{nextVerifyDept},</if>
- <if test="roleId != null">ROLE_ID = #{roleId},</if>
- UPDATE_TIME = NOW()
- </set>
- where ID = #{id}
- </update>
- <update id="batchRemove">
- UPDATE gy_data
- SET DELETE_STATUS = 1,
- del_unigue_key = ID,
- UPDATE_TIME = NOW()
- WHERE ID IN
- <foreach item="id" collection="array" open="(" separator="," close=")">
- #{id}
- </foreach>
- </update>
- <select id="countTotal4Del" resultType="int">
- SELECT
- count(*)
- FROM gy_data b
- <where>
- b.GY_NUIT_ID =#{gyUnitId}
- </where>
- </select>
- <update id="remove">
- UPDATE gy_data
- SET DELETE_STATUS = 1,
- del_unigue_key = ID,
- UPDATE_TIME = NOW()
- WHERE
- ID = #{value}
- </update>
- <delete id="batchPhysicalDeletion">
- DELETE FROM gy_data
- WHERE ID IN
- <foreach item="id" collection="array" open="(" separator="," close=")">
- #{id}
- </foreach>
- </delete>
- <select id="countAaAssData" resultType="int">
- SELECT
- count(*)
- FROM ra_ass_data b
- <where>
- b.gy_data_id =#{id}
- </where>
- </select>
- </mapper>
|