| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548 |
- <?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="cn.com.goldenwater.dcproj.dao.ChkSafeProdLedgerDao">
- <resultMap id="BaseResultMap" type="cn.com.goldenwater.dcproj.model.ChkSafeProdLedger">
- <id column="ID" jdbcType="VARCHAR" property="id" />
- <result column="ORG_ID" jdbcType="VARCHAR" property="orgId" />
- <result column="AD_CODE" jdbcType="VARCHAR" property="adCode" />
- <result column="AD_NAME" jdbcType="VARCHAR" property="adName" />
- <result column="CHK_MNTH" jdbcType="DATE" property="chkMnth" />
- <result column="CHK_PROJ_TYPE" jdbcType="VARCHAR" property="chkProjType" />
- <result column="CHK_DTTM" jdbcType="DATE" property="chkDttm" />
- <result column="LEAD_DEP" jdbcType="VARCHAR" property="leadDep" />
- <result column="LEAD_DEP_RESP_PERS" jdbcType="VARCHAR" property="leadDepRespPers" />
- <result column="CHK_ORG" jdbcType="VARCHAR" property="chkOrg" />
- <result column="CHK_ORG_RESP_PERS" jdbcType="VARCHAR" property="chkOrgRespPers" />
- <result column="CHK_ORG_RESP_PERS_MOBI" jdbcType="VARCHAR" property="chkOrgRespPersMobi" />
- <result column="CHK_RESULT" jdbcType="VARCHAR" property="chkResult" />
- <result column="CHK_DGER_PBLM" property="chkDgerPblm" />
- <result column="CHK_HAND_SUGG" jdbcType="VARCHAR" property="chkHandSugg" />
- <result column="CHK_HAND_EDTM" jdbcType="DATE" property="chkHandEdtm" />
- <result column="CHK_RECT_IMPL_INFO" jdbcType="VARCHAR" property="chkRectImplInfo" />
- <result column="CHK_RECT_IMPL_INFO_DESC" jdbcType="VARCHAR" property="chkRectImplInfoDesc" />
- <result column="CHK_ACCE_TM" jdbcType="DATE" property="chkAcceTm" />
- <result column="CHK_ACCE_PERS" jdbcType="VARCHAR" property="chkAccePers" />
- <result column="CHK_TOTAL_PBLM_NUM" jdbcType="DECIMAL" property="chkTotalPblmNum" />
- <result column="CHK_TOTAL_RECT_NUM" jdbcType="DECIMAL" property="chkTotalRectNum" />
- <result column="CHK_FILL_UNIT" property="chkFillUnit" />
- <result column="CHK_SUBMIT_DEPT" jdbcType="VARCHAR" property="chkSubmitDept" />
- <result column="CHK_SUBMIT_DTTM" jdbcType="DATE" property="chkSubmitDttm" />
- <result column="FILL_REPO_STAT" jdbcType="VARCHAR" property="fillRepoStat" />
- <result column="NOTE" jdbcType="VARCHAR" property="note" />
- <result column="PERS_ID" jdbcType="VARCHAR" property="persId" />
- <result column="INTM" jdbcType="DATE" property="intm" />
- <result column="UPTM" jdbcType="DATE" property="uptm" />
- <result column="DATA_STAT" jdbcType="VARCHAR" property="dataStat" />
- </resultMap>
- <sql id="Base_Column_List">
- ID, ORG_ID, AD_CODE, CHK_MNTH, CHK_PROJ_TYPE, CHK_DTTM, LEAD_DEP, LEAD_DEP_RESP_PERS, CHK_ORG, CHK_ORG_RESP_PERS,
- CHK_ORG_RESP_PERS_MOBI, CHK_RESULT, CHK_DGER_PBLM, CHK_HAND_SUGG, CHK_HAND_EDTM, CHK_RECT_IMPL_INFO, CHK_RECT_IMPL_INFO_DESC,
- CHK_ACCE_TM, CHK_ACCE_PERS, CHK_TOTAL_PBLM_NUM, CHK_TOTAL_RECT_NUM, CHK_FILL_UNIT, CHK_SUBMIT_DEPT,
- CHK_SUBMIT_DTTM, FILL_REPO_STAT, NOTE, PERS_ID, INTM, UPTM, DATA_STAT
- </sql>
- <sql id="page_where">
- <trim prefix="where" prefixOverrides="and | or ">
- <if test="id != null and id != ''">
- and cspl.ID = #{id}
- </if>
- <if test="orgId != null and orgId != ''">
- and cspl.ORG_ID = #{orgId}
- </if>
- <if test="adCode != null and adCode != ''">
- and cspl.AD_CODE like '${adCode}%'
- </if>
- <if test="chkMnth != null">
- <!-- and to_char(cspl.CHK_MNTH,'yyyy-MM') = to_char(#{chkMnth},'yyyy-MM')-->
- and to_char(cspl.CHK_DTTM,'yyyy-MM') = to_char(#{chkMnth},'yyyy-MM')
- </if>
- <if test='chkProjType != null and "" != chkProjType'>
- and cspl.CHK_PROJ_TYPE = #{chkProjType}
- </if>
- <if test="chkDttm != null">
- and to_char(cspl.CHK_DTTM,'yyyy-MM-dd') = to_char(#{chkDttm},'yyyy-MM-dd')
- </if>
- <if test="leadDep != null and leadDep != ''">
- and cspl.LEAD_DEP LIKE '%${leadDep}%'
- </if>
- <if test="leadDepRespPers != null and leadDepRespPers != ''">
- and cspl.LEAD_DEP_RESP_PERS = #{leadDepRespPers,jdbcType=VARCHAR}
- </if>
- <if test="chkOrg != null and chkOrg != ''">
- and cspl.CHK_ORG LIKE '%${chkOrg}%'
- </if>
- <if test="chkOrgRespPers != null and chkOrgRespPers != ''">
- and cspl.CHK_ORG_RESP_PERS = #{chkOrgRespPers,jdbcType=VARCHAR}
- </if>
- <if test="chkOrgRespPersMobi != null and chkOrgRespPersMobi != ''">
- and cspl.CHK_ORG_RESP_PERS_MOBI = #{chkOrgRespPersMobi,jdbcType=VARCHAR}
- </if>
- <if test="chkResult != null and chkResult != ''">
- and cspl.CHK_RESULT = #{chkResult,jdbcType=VARCHAR}
- </if>
- <if test="chkDgerPblm != null and chkDgerPblm != ''">
- and cspl.CHK_DGER_PBLM like '%${chkDgerPblm}%'
- </if>
- <if test="chkHandSugg != null and chkHandSugg != ''">
- and cspl.CHK_HAND_SUGG = #{chkHandSugg,jdbcType=VARCHAR}
- </if>
- <if test="chkHandEdtm != null">
- and cspl.CHK_HAND_EDTM = #{chkHandEdtm,jdbcType=DATE}
- </if>
- <if test="chkRectImplInfo != null and chkRectImplInfo != ''">
- and cspl.CHK_RECT_IMPL_INFO = #{chkRectImplInfo,jdbcType=VARCHAR}
- </if>
- <if test="chkRectImplInfoDesc != null and chkRectImplInfoDesc != ''">
- and cspl.CHK_RECT_IMPL_INFO_DESC like '%${chkRectImplInfoDesc}%'
- </if>
- <if test="chkAcceTm != null">
- and cspl.CHK_ACCE_TM = #{chkAcceTm,jdbcType=DATE}
- </if>
- <if test="chkAccePers != null and chkAccePers != ''">
- and cspl.CHK_ACCE_PERS = #{chkAccePers,jdbcType=VARCHAR}
- </if>
- <if test="chkTotalPblmNum != null">
- and cspl.CHK_TOTAL_PBLM_NUM = #{chkTotalPblmNum,jdbcType=DECIMAL}
- </if>
- <if test="chkTotalRectNum != null">
- and cspl.CHK_TOTAL_RECT_NUM = #{chkTotalRectNum,jdbcType=DECIMAL}
- </if>
- <if test="chkFillUnit != null and chkFillUnit != ''">
- and cspl.CHK_FILL_UNIT LIKE '%${chkFillUnit}%'
- </if>
- <if test="chkSubmitDept != null and chkSubmitDept != ''">
- and cspl.CHK_SUBMIT_DEPT LIKE '%${chkSubmitDept}%'
- </if>
- <if test="chkSubmitDttm != null">
- and cspl.CHK_SUBMIT_DTTM = #{chkSubmitDttm,jdbcType=DATE}
- </if>
- <if test="fillRepoStat != null and fillRepoStat != ''">
- and cspl.FILL_REPO_STAT = #{fillRepoStat,jdbcType=VARCHAR}
- </if>
- <if test="note != null and note != ''">
- and cspl.NOTE = #{note,jdbcType=VARCHAR}
- </if>
- <if test="persId != null and persId != ''">
- and cspl.PERS_ID = #{persId,jdbcType=VARCHAR}
- </if>
- <if test="intm != null">
- and cspl.INTM = #{intm,jdbcType=DATE}
- </if>
- <if test="uptm != null">
- and cspl.UPTM = #{uptm,jdbcType=DATE}
- </if>
- and cspl.DATA_STAT = '0'
- </trim>
- </sql>
- <select id="findList" resultMap="BaseResultMap">
- select cspl.*,aab.AD_FULL_NAME AD_NAME from CHK_SAFE_PROD_LEDGER cspl left join ATT_AD_BASE aab on cspl.AD_CODE = aab.AD_CODE <include refid="page_where" />
- order by cspl.CHK_DTTM desc , cspl.AD_CODE asc , to_number(cspl.CHK_PROJ_TYPE) asc, cspl.INTM desc
- </select>
- <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
- select
- <include refid="Base_Column_List" />
- from CHK_SAFE_PROD_LEDGER
- where ID = #{id,jdbcType=VARCHAR}
- </select>
- <delete id="delete" parameterType="java.lang.String">
- update CHK_SAFE_PROD_LEDGER set DATA_STAT = '9'
- where ID = #{id,jdbcType=VARCHAR}
- </delete>
- <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.ChkSafeProdLedger">
- insert into CHK_SAFE_PROD_LEDGER (ID, ORG_ID, AD_CODE,
- CHK_MNTH, CHK_PROJ_TYPE, CHK_DTTM, LEAD_DEP,
- LEAD_DEP_RESP_PERS, CHK_ORG, CHK_ORG_RESP_PERS,
- CHK_ORG_RESP_PERS_MOBI, CHK_RESULT, CHK_DGER_PBLM,CHK_HAND_SUGG,
- CHK_HAND_EDTM, CHK_RECT_IMPL_INFO, CHK_RECT_IMPL_INFO_DESC, CHK_ACCE_TM,
- CHK_ACCE_PERS, CHK_TOTAL_PBLM_NUM, CHK_TOTAL_RECT_NUM, CHK_FILL_UNIT,
- CHK_SUBMIT_DEPT, CHK_SUBMIT_DTTM, FILL_REPO_STAT,
- NOTE, PERS_ID, INTM, UPTM,
- DATA_STAT)
- values (#{id,jdbcType=VARCHAR}, #{orgId,jdbcType=VARCHAR}, #{adCode,jdbcType=VARCHAR},
- #{chkMnth,jdbcType=DATE}, #{chkProjType}, #{chkDttm,jdbcType=DATE}, #{leadDep,jdbcType=VARCHAR},
- #{leadDepRespPers,jdbcType=VARCHAR}, #{chkOrg,jdbcType=VARCHAR}, #{chkOrgRespPers,jdbcType=VARCHAR},
- #{chkOrgRespPersMobi,jdbcType=VARCHAR}, #{chkResult,jdbcType=VARCHAR},#{chkDgerPblm,jdbcType=VARCHAR}, #{chkHandSugg,jdbcType=VARCHAR},
- #{chkHandEdtm,jdbcType=DATE}, #{chkRectImplInfo,jdbcType=VARCHAR}, #{chkRectImplInfoDesc,jdbcType=VARCHAR}, #{chkAcceTm,jdbcType=DATE},
- #{chkAccePers,jdbcType=VARCHAR}, #{chkTotalPblmNum,jdbcType=DECIMAL}, #{chkTotalRectNum,jdbcType=DECIMAL},
- #{chkFillUnit,jdbcType=VARCHAR},#{chkSubmitDept,jdbcType=VARCHAR}, #{chkSubmitDttm,jdbcType=DATE}, #{fillRepoStat,jdbcType=VARCHAR},
- #{note,jdbcType=VARCHAR}, #{persId,jdbcType=VARCHAR}, #{intm,jdbcType=DATE}, #{uptm,jdbcType=DATE},
- #{dataStat,jdbcType=VARCHAR})
- </insert>
- <insert id="insertBatchFile" parameterType="java.util.List" useGeneratedKeys="false">
- insert into CHK_SAFE_PROD_LEDGER
- (ID, ORG_ID, AD_CODE,CHK_MNTH, CHK_PROJ_TYPE, CHK_DTTM, LEAD_DEP,LEAD_DEP_RESP_PERS, CHK_ORG, CHK_ORG_RESP_PERS,
- CHK_ORG_RESP_PERS_MOBI, CHK_RESULT, CHK_DGER_PBLM,CHK_HAND_SUGG, CHK_HAND_EDTM, CHK_RECT_IMPL_INFO,CHK_RECT_IMPL_INFO_DESC, CHK_ACCE_TM,
- CHK_ACCE_PERS, CHK_TOTAL_PBLM_NUM, CHK_TOTAL_RECT_NUM, CHK_FILL_UNIT,CHK_SUBMIT_DEPT, CHK_SUBMIT_DTTM, FILL_REPO_STAT,
- NOTE, PERS_ID, INTM, UPTM,DATA_STAT)
- select t.* from (
- <foreach item="item" index="index" collection="list" separator="union all">
- select #{item.id} ,#{item.orgId} ,#{item.adCode},#{item.chkMnth},,#{item.chkProjType},#{item.chkDttm},#{item.leadDep},#{item.leadDepRespPers},
- #{item.chkOrg},#{item.chkOrgRespPers},#{item.chkOrgRespPersMobi},#{item.chkResult},#{item.chkDgerPblm},#{item.chkHandSugg},#{item.chkHandEdtm},
- #{item.chkRectImplInfo},#{item.chkRectImplInfoDesc},#{item.chkAcceTm},#{item.chkAccePers},#{item.chkTotalPblmNum},#{item.chkTotalRectNum},#{item.chkFillUnit},#{item.chkSubmitDept},
- #{item.chkSubmitDttm},#{item.fillRepoStat},#{item.note},#{item.persId},#{item.intm},#{item.uptm},#{item.dataStat}
- from dual
- </foreach>
- )t
- </insert>
- <insert id="insertSelective" parameterType="cn.com.goldenwater.dcproj.model.ChkSafeProdLedger">
- insert into CHK_SAFE_PROD_LEDGER
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="id != null and id != ''">
- ID,
- </if>
- <if test="orgId != null and orgId != ''">
- ORG_ID,
- </if>
- <if test="adCode != null and adCode != ''">
- AD_CODE,
- </if>
- <if test="chkMnth != null">
- CHK_MNTH,
- </if>
- <if test='chkProjType != null and "" != chkProjType'>
- CHK_PROJ_TYPE,
- </if>
- <if test="chkDttm != null">
- CHK_DTTM,
- </if>
- <if test="leadDep != null and leadDep != ''">
- LEAD_DEP,
- </if>
- <if test="leadDepRespPers != null and leadDepRespPers != ''">
- LEAD_DEP_RESP_PERS,
- </if>
- <if test="chkOrg != null and chkOrg != ''">
- CHK_ORG,
- </if>
- <if test="chkOrgRespPers != null and chkOrgRespPers != ''">
- CHK_ORG_RESP_PERS,
- </if>
- <if test="chkOrgRespPersMobi != null and chkOrgRespPersMobi != ''">
- CHK_ORG_RESP_PERS_MOBI,
- </if>
- <if test="chkResult != null and chkResult != ''">
- CHK_RESULT,
- </if>
- <if test="chkDgerPblm != null and chkDgerPblm != ''">
- CHK_DGER_PBLM,
- </if>
- <if test="chkHandSugg != null and chkHandSugg != ''">
- CHK_HAND_SUGG,
- </if>
- <if test="chkHandEdtm != null">
- CHK_HAND_EDTM,
- </if>
- <if test="chkRectImplInfo != null and chkRectImplInfo != ''">
- CHK_RECT_IMPL_INFO,
- </if>
- <if test="chkRectImplInfoDesc != null and chkRectImplInfoDesc != ''">
- CHK_RECT_IMPL_INFO_DESC,
- </if>
- <if test="chkAcceTm != null">
- CHK_ACCE_TM,
- </if>
- <if test="chkAccePers != null and chkAccePers != ''">
- CHK_ACCE_PERS,
- </if>
- <if test="chkTotalPblmNum != null">
- CHK_TOTAL_PBLM_NUM,
- </if>
- <if test="chkTotalRectNum != null">
- CHK_TOTAL_RECT_NUM,
- </if>
- <if test="chkFillUnit != null and chkFillUnit != ''">
- CHK_FILL_UNIT,
- </if>
- <if test="chkSubmitDept != null and chkSubmitDept != ''">
- CHK_SUBMIT_DEPT,
- </if>
- <if test="chkSubmitDttm != null">
- CHK_SUBMIT_DTTM,
- </if>
- <if test="fillRepoStat != null and fillRepoStat != ''">
- FILL_REPO_STAT,
- </if>
- <if test="note != null and note != ''">
- NOTE,
- </if>
- <if test="persId != null and persId != ''">
- PERS_ID,
- </if>
- <if test="intm != null">
- INTM,
- </if>
- <if test="uptm != null">
- UPTM,
- </if>
- <if test="dataStat != null and dataStat != ''">
- DATA_STAT,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="id != null and id != ''">
- #{id,jdbcType=VARCHAR},
- </if>
- <if test="orgId != null and orgId != ''">
- #{orgId,jdbcType=VARCHAR},
- </if>
- <if test="adCode != null and adCode != ''">
- #{adCode,jdbcType=VARCHAR},
- </if>
- <if test="chkMnth != null">
- #{chkMnth,jdbcType=DATE},
- </if>
- <if test='chkProjType != null and "" != chkProjType'>
- #{chkProjType},
- </if>
- <if test="chkDttm != null">
- #{chkDttm,jdbcType=DATE},
- </if>
- <if test="leadDep != null and leadDep != ''">
- #{leadDep,jdbcType=VARCHAR},
- </if>
- <if test="leadDepRespPers != null and leadDepRespPers != ''">
- #{leadDepRespPers,jdbcType=VARCHAR},
- </if>
- <if test="chkOrg != null and chkOrg != ''">
- #{chkOrg,jdbcType=VARCHAR},
- </if>
- <if test="chkOrgRespPers != null and chkOrgRespPers != ''">
- #{chkOrgRespPers,jdbcType=VARCHAR},
- </if>
- <if test="chkOrgRespPersMobi != null and chkOrgRespPersMobi != ''">
- #{chkOrgRespPersMobi,jdbcType=VARCHAR},
- </if>
- <if test="chkResult != null and chkResult != ''">
- #{chkResult,jdbcType=VARCHAR},
- </if>
- <if test="chkDgerPblm != null and chkDgerPblm != ''">
- #{chkDgerPblm},
- </if>
- <if test="chkHandSugg != null and chkHandSugg != ''">
- #{chkHandSugg,jdbcType=VARCHAR},
- </if>
- <if test="chkHandEdtm != null">
- #{chkHandEdtm,jdbcType=DATE},
- </if>
- <if test="chkRectImplInfo != null and chkRectImplInfo != ''">
- #{chkRectImplInfo,jdbcType=VARCHAR},
- </if>
- <if test="chkRectImplInfoDesc != null and chkRectImplInfoDesc != ''">
- #{chkRectImplInfoDesc,jdbcType=VARCHAR},
- </if>
- <if test="chkAcceTm != null">
- #{chkAcceTm,jdbcType=DATE},
- </if>
- <if test="chkAccePers != null and chkAccePers != ''">
- #{chkAccePers,jdbcType=VARCHAR},
- </if>
- <if test="chkTotalPblmNum != null">
- #{chkTotalPblmNum,jdbcType=DECIMAL},
- </if>
- <if test="chkTotalRectNum != null">
- #{chkTotalRectNum,jdbcType=DECIMAL},
- </if>
- <if test="chkFillUnit != null and chkFillUnit != ''">
- #{chkFillUnit},
- </if>
- <if test="chkSubmitDept != null and chkSubmitDept != ''">
- #{chkSubmitDept,jdbcType=VARCHAR},
- </if>
- <if test="chkSubmitDttm != null">
- #{chkSubmitDttm,jdbcType=DATE},
- </if>
- <if test="fillRepoStat != null and fillRepoStat != ''">
- #{fillRepoStat,jdbcType=VARCHAR},
- </if>
- <if test="note != null and note != ''">
- #{note,jdbcType=VARCHAR},
- </if>
- <if test="persId != null and persId != ''">
- #{persId,jdbcType=VARCHAR},
- </if>
- <if test="intm != null">
- #{intm,jdbcType=DATE},
- </if>
- <if test="uptm != null">
- #{uptm,jdbcType=DATE},
- </if>
- <if test="dataStat != null and dataStat != ''">
- #{dataStat,jdbcType=VARCHAR},
- </if>
- </trim>
- </insert>
- <update id="update" parameterType="cn.com.goldenwater.dcproj.model.ChkSafeProdLedger">
- update CHK_SAFE_PROD_LEDGER
- <set>
- <if test="orgId != null and orgId != ''">
- ORG_ID = #{orgId,jdbcType=VARCHAR},
- </if>
- <if test="adCode != null and adCode != ''">
- AD_CODE = #{adCode,jdbcType=VARCHAR},
- </if>
- <if test="chkMnth != null">
- CHK_MNTH = #{chkMnth,jdbcType=DATE},
- </if>
- <if test='chkProjType != null and "" != chkProjType'>
- CHK_PROJ_TYPE = #{chkProjType},
- </if>
- <if test="chkDttm != null">
- CHK_DTTM = #{chkDttm,jdbcType=DATE},
- </if>
- <if test="leadDep != null and leadDep != ''">
- LEAD_DEP = #{leadDep,jdbcType=VARCHAR},
- </if>
- <if test="leadDepRespPers != null and leadDepRespPers != ''">
- LEAD_DEP_RESP_PERS = #{leadDepRespPers,jdbcType=VARCHAR},
- </if>
- <if test="chkOrg != null and chkOrg != ''">
- CHK_ORG = #{chkOrg,jdbcType=VARCHAR},
- </if>
- <if test="chkOrgRespPers != null and chkOrgRespPers != ''">
- CHK_ORG_RESP_PERS = #{chkOrgRespPers,jdbcType=VARCHAR},
- </if>
- <if test="chkOrgRespPersMobi != null and chkOrgRespPersMobi != ''">
- CHK_ORG_RESP_PERS_MOBI = #{chkOrgRespPersMobi,jdbcType=VARCHAR},
- </if>
- <if test="chkResult != null and chkResult != ''">
- CHK_RESULT = #{chkResult,jdbcType=VARCHAR},
- </if>
- <if test="chkDgerPblm != null and chkDgerPblm != ''">
- CHK_DGER_PBLM = #{chkDgerPblm},
- </if>
- <if test="chkHandSugg != null and chkHandSugg != ''">
- CHK_HAND_SUGG = #{chkHandSugg,jdbcType=VARCHAR},
- </if>
- <if test="chkHandEdtm != null">
- CHK_HAND_EDTM = #{chkHandEdtm,jdbcType=DATE},
- </if>
- <if test="chkRectImplInfo != null and chkRectImplInfo != ''">
- CHK_RECT_IMPL_INFO = #{chkRectImplInfo,jdbcType=VARCHAR},
- </if>
- <if test="chkRectImplInfoDesc != null and chkRectImplInfoDesc != ''">
- CHK_RECT_IMPL_INFO_DESC = #{chkRectImplInfoDesc,jdbcType=VARCHAR},
- </if>
- <if test="chkAcceTm != null">
- CHK_ACCE_TM = #{chkAcceTm,jdbcType=DATE},
- </if>
- <if test="chkAccePers != null and chkAccePers != ''">
- CHK_ACCE_PERS = #{chkAccePers,jdbcType=VARCHAR},
- </if>
- <if test="chkTotalPblmNum != null">
- CHK_TOTAL_PBLM_NUM = #{chkTotalPblmNum,jdbcType=DECIMAL},
- </if>
- <if test="chkTotalRectNum != null">
- CHK_TOTAL_RECT_NUM = #{chkTotalRectNum,jdbcType=DECIMAL},
- </if>
- <if test="chkFillUnit != null and chkFillUnit != ''">
- CHK_FILL_UNIT = #{chkFillUnit},
- </if>
- <if test="chkSubmitDept != null and chkSubmitDept != ''">
- CHK_SUBMIT_DEPT = #{chkSubmitDept,jdbcType=VARCHAR},
- </if>
- <if test="chkSubmitDttm != null">
- CHK_SUBMIT_DTTM = #{chkSubmitDttm,jdbcType=DATE},
- </if>
- <if test="note != null and note != ''">
- NOTE = #{note,jdbcType=VARCHAR},
- </if>
- <if test="persId != null and persId != ''">
- PERS_ID = #{persId,jdbcType=VARCHAR},
- </if>
- <if test="intm != null">
- INTM = #{intm,jdbcType=DATE},
- </if>
- <if test="uptm != null">
- UPTM = #{uptm,jdbcType=DATE},
- </if>
- <if test="dataStat != null and dataStat != ''">
- DATA_STAT = #{dataStat,jdbcType=VARCHAR},
- </if>
- </set>
- where ID = #{id,jdbcType=VARCHAR}
- </update>
- <update id="updateByPrimaryKey" parameterType="cn.com.goldenwater.dcproj.model.ChkSafeProdLedger">
- update CHK_SAFE_PROD_LEDGER
- set ORG_ID = #{orgId,jdbcType=VARCHAR},
- AD_CODE = #{adCode,jdbcType=VARCHAR},
- CHK_MNTH = #{chkMnth,jdbcType=DATE},
- CHK_PROJ_TYPE = #{chkProjType},
- CHK_DTTM = #{chkDttm,jdbcType=DATE},
- LEAD_DEP = #{leadDep,jdbcType=VARCHAR},
- LEAD_DEP_RESP_PERS = #{leadDepRespPers,jdbcType=VARCHAR},
- CHK_ORG = #{chkOrg,jdbcType=VARCHAR},
- CHK_ORG_RESP_PERS = #{chkOrgRespPers,jdbcType=VARCHAR},
- CHK_ORG_RESP_PERS_MOBI = #{chkOrgRespPersMobi,jdbcType=VARCHAR},
- CHK_RESULT = #{chkResult,jdbcType=VARCHAR},
- CHK_DGER_PBLM = #{chkDgerPblm},
- CHK_HAND_SUGG = #{chkHandSugg,jdbcType=VARCHAR},
- CHK_HAND_EDTM = #{chkHandEdtm,jdbcType=DATE},
- CHK_RECT_IMPL_INFO = #{chkRectImplInfo,jdbcType=VARCHAR},
- CHK_RECT_IMPL_INFO_DESC = #{chkRectImplInfoDesc,jdbcType=VARCHAR},
- CHK_ACCE_TM = #{chkAcceTm,jdbcType=DATE},
- CHK_ACCE_PERS = #{chkAccePers,jdbcType=VARCHAR},
- CHK_TOTAL_PBLM_NUM = #{chkTotalPblmNum,jdbcType=DECIMAL},
- CHK_TOTAL_RECT_NUM = #{chkTotalRectNum,jdbcType=DECIMAL},
- CHK_FILL_UNIT = #{chkFillUnit},
- CHK_SUBMIT_DEPT = #{chkSubmitDept,jdbcType=VARCHAR},
- CHK_SUBMIT_DTTM = #{chkSubmitDttm,jdbcType=DATE},
- NOTE = #{note,jdbcType=VARCHAR},
- PERS_ID = #{persId,jdbcType=VARCHAR},
- INTM = #{intm,jdbcType=DATE},
- UPTM = #{uptm,jdbcType=DATE},
- DATA_STAT = #{dataStat,jdbcType=VARCHAR}
- where ID = #{id,jdbcType=VARCHAR}
- </update>
- <!-- 批量上报 -->
- <update id="batchReportByIds" >
- update CHK_SAFE_PROD_LEDGER
- set FILL_REPO_STAT = '2', UPTM = #{uptm}
- where FILL_REPO_STAT = '1' and ID in
- <foreach item="id" collection="ids" open="(" separator="," close=")">
- #{id}
- </foreach>
- </update>
- <!-- 市级统计查询 -->
- <select id="summaryList" resultType="java.util.Map">
- select t.*
- from
- (select to_date(concat(to_char(CHK_DTTM,'YYYY-MM'),'-01') ,'YYYY-MM-DD') as "chkMnth" ,
- <!-- 巡查个次 -->
- count(ID) as chkNum,
- <!-- 隐患数量 检查结果 0 无隐患 1有隐患 -->
- SUM( CASE WHEN CHK_RESULT = '1' THEN 1 ELSE 0 END ) as pblmNum ,
- <!-- 隐患未整改 -->
- SUM( CASE CHK_RECT_IMPL_INFO WHEN '0' THEN 1 ELSE 0 END ) as rectNotNum ,
- <!-- 隐患整改 -->
- SUM( CASE CHK_RECT_IMPL_INFO WHEN '1' THEN 1 WHEN '2' THEN 1 ELSE 0 END ) as rectDoNum
- from CHK_SAFE_PROD_LEDGER
- <trim prefix="where" prefixOverrides="and | or ">
- FILL_REPO_STAT = '2' and DATA_STAT = '0'
- <if test="chkMnth != null">
- and to_char(CHK_DTTM,'YYYY-MM') = to_char(#{chkMnth},'YYYY-MM')
- </if>
- <if test="chkMnthList != null">
- and
- <foreach item="item" index="index" collection="chkMnthList" open="(" separator="or" close=")">
- to_char(CHK_DTTM,'YYYY-MM') = to_char(#{item},'YYYY-MM')
- </foreach>
- </if>
- <if test='chkProjType != null and "" != chkProjType'>
- and CHK_PROJ_TYPE = #{chkProjType}
- </if>
- <!-- 市级 、 县级 行政区过滤 -->
- <if test=' null != adCode '>
- and
- <foreach item="item" index="index" collection="adCode.split(',')" open="(" separator="or" close=")">
- AD_CODE like concat('${item}','%')
- </foreach>
- </if>
- </trim>
- group by to_date(concat(to_char(CHK_DTTM,'YYYY-MM'),'-01') ,'YYYY-MM-DD')
- ) t
- order by t."chkMnth" desc
- </select>
- </mapper>
|