| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290 |
- <?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.TacPblmRectOrgDao">
- <resultMap type="cn.com.goldenwater.dcproj.model.TacPblmRectOrg" id="tacPblmRectOrgResultMap">
- <result property="fileId" column="FILE_ID"/>
- <result property="fileName" column="FILE_NAME"/>
- <result property="filePath" column="FILE_PATH"/>
- <result property="rectFileId" column="RECT_FILE_ID"/>
- <result property="rectFileName" column="RECT_FILE_NAME"/>
- <result property="rectFilePath" column="RECT_FILE_PATH"/>
- <result property="title" column="TITLE"/>
- <result property="nub" column="NUB"/>
- <result property="explain" column="EXPLAIN"/>
- <result property="printTm" column="PRINT_TM"/>
- <result property="closeTm" column="CLOSE_TM"/>
- <result property="sndFileId" column="SND_FILE_ID"/>
- <result property="sndFileName" column="SND_FILE_NAME"/>
- <result property="sndFilePath" column="SND_FILE_PATH"/>
- <result property="id" column="ID"/>
- <result property="rectId" column="RECT_ID"/>
- <result property="year" column="YEAR"/>
- <result property="batch" column="BATCH"/>
- <result property="rectOrgId" column="RECT_ORG_ID"/>
- <result property="rectOrgNm" column="RECT_ORG_NM"/>
- <result property="prjctSize" column="PRJCT_SIZE"/>
- <result property="pblmSize" column="PBLM_SIZE"/>
- <result property="state" column="STATE"/>
- <result property="rectTm" column="RECT_TM"/>
- <result property="rectNub" column="RECT_NUB"/>
- <result property="chkState" column="CHK_STATE"/>
- <result property="chkPersInfo" column="CHK_PERS_INFO"/>
- <result property="placeDuty" column="PLACE_DUTY"/>
- <result property="rectPersId" column="RECT_PERS_ID"/>
- <result property="rectPersName" column="RECT_PERS_NAME"/>
- <result property="dutyTrace" column="DUTY_TRACE"/>
- <result property="persId" column="PERS_ID"/>
- <result property="persName" column="PERS_NAME"/>
- <result property="intm" column="INTM"/>
- <result property="uptm" column="UPTM"/>
- <result property="dataStat" column="DATA_STAT"/>
- </resultMap>
- <sql id="table_columns">
- FILE_ID,
- FILE_NAME,
- FILE_PATH,
- RECT_FILE_ID,
- RECT_FILE_NAME,
- RECT_FILE_PATH,
- TITLE,
- NUB,
- `EXPLAIN`,
- PRINT_TM,
- CLOSE_TM,
- ID,
- RECT_ID,
- `YEAR`,
- BATCH,
- RECT_ORG_ID,
- RECT_ORG_NM,
- PRJCT_SIZE,
- PBLM_SIZE,
- STATE,
- RECT_TM,
- RECT_NUB,
- CHK_STATE,
- CHK_PERS_INFO,
- PLACE_DUTY,
- RECT_PERS_ID,
- RECT_PERS_NAME,
- DUTY_TRACE,
- PERS_ID,
- PERS_NAME,
- INTM,
- UPTM,
- DATA_STAT
- </sql>
- <sql id="entity_properties">
- #{fileId},
- #{fileName},
- #{filePath},
- #{rectFileId},
- #{rectFileName},
- #{rectFilePath},
- #{title},
- #{nub},
- #{explain},
- #{printTm},
- #{closeTm},
- #{id},
- #{rectId},
- #{year},
- #{batch},
- #{rectOrgId},
- #{rectOrgNm},
- #{prjctSize},
- #{pblmSize},
- #{state},
- #{rectTm},
- #{rectNub},
- #{chkState},
- #{chkPersInfo},
- #{placeDuty},
- #{rectPersId},
- #{rectPersName},
- #{dutyTrace},
- #{persId},
- #{persName},
- #{intm},
- #{uptm},
- #{dataStat}
- </sql>
- <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
- <sql id="page_where">
- <trim prefix="where" prefixOverrides="and | or ">
- <if test="fileName != null and fileName != ''">and A.FILE_NAME = #{fileName}</if>
- <if test="filePath != null and filePath != ''">and A.FILE_PATH = #{filePath}</if>
- <if test="rectFileId != null and rectFileId != ''">and RECT_FILE_ID = #{rectFileId}</if>
- <if test="rectFileName != null and rectFileName != ''">and RECT_FILE_NAME = #{rectFileName}</if>
- <if test="rectFilePath != null and rectFilePath != ''">and RECT_FILE_PATH = #{rectFilePath}</if>
- <if test="title != null and title != ''">and TITLE = #{title}</if>
- <if test="nub != null and nub != ''">and NUB = #{nub}</if>
- <if test="explain != null and explain != ''">and `EXPLAIN` = #{explain}</if>
- <if test="printTm != null">and PRINT_TM = #{printTm}</if>
- <if test="closeTm != null">and CLOSE_TM = #{closeTm}</if>
- <if test="sndFileId != null and sndFileId != ''">and SND_FILE_ID = #{sndFileId}</if>
- <if test="sndFileName != null and sndFileName != ''">and SND_FILE_NAME = #{sndFileName}</if>
- <if test="sndFilePath != null and sndFilePath != ''">and SND_FILE_PATH = #{sndFilePath}</if>
- <if test="id != null and id != ''">and ID = #{id}</if>
- <if test="rectId != null and rectId != ''">and RECT_ID = #{rectId}</if>
- <if test="year != null and year != ''">and YEAR = #{year}</if>
- <if test="batch != null and batch != ''">and BATCH = #{batch}</if>
- <if test="rectOrgId != null and rectOrgId != ''">and RECT_ORG_ID = #{rectOrgId}</if>
- <if test="rectOrgNm != null and rectOrgNm != ''">and RECT_ORG_NM = #{rectOrgNm}</if>
- <if test="prjctSize != null and prjctSize != ''">and PRJCT_SIZE = #{prjctSize}</if>
- <if test="pblmSize != null and pblmSize != ''">and PBLM_SIZE = #{pblmSize}</if>
- <if test="state != null and state != ''">and STATE in (${state})</if>
- <if test="rectTm != null">and RECT_TM = #{rectTm}</if>
- <if test="rectNub != null and rectNub != ''">and RECT_NUB = #{rectNub}</if>
- <if test="chkState != null and chkState != ''">and CHK_STATE = #{chkState}</if>
- <if test="chkPersInfo != null and chkPersInfo != ''">and CHK_PERS_INFO = #{chkPersInfo}</if>
- <if test="placeDuty != null and placeDuty != ''">and PLACE_DUTY = #{placeDuty}</if>
- <if test="rectPersId != null and rectPersId != ''">and RECT_PERS_ID = #{rectPersId}</if>
- <if test="rectPersName != null and rectPersName != ''">and RECT_PERS_NAME = #{rectPersName}</if>
- <if test="dutyTrace != null and dutyTrace != ''">and DUTY_TRACE = #{dutyTrace}</if>
- <if test="persId != null and persId != ''">and PERS_ID = #{persId}</if>
- <if test="persName != null and persName != ''">and PERS_NAME = #{persName}</if>
- <if test="intm != null">and INTM = #{intm}</if>
- <if test="uptm != null">and UPTM = #{uptm}</if>
- <if test="dataStat != null and dataStat != ''">and DATA_STAT = #{dataStat}</if>
- and DATA_STAT='0'
- </trim>
- </sql>
- <select id="get" resultMap="tacPblmRectOrgResultMap" parameterType="String">
- select FILE_ID, A.FILE_NAME, A.FILE_PATH,
- RECT_FILE_ID, RECT_FILE_NAME, RECT_FILE_PATH, TITLE, NUB,
- `EXPLAIN`, PRINT_TM, CLOSE_TM, A.ID, RECT_ID, `YEAR`, BATCH,
- RECT_ORG_ID, RECT_ORG_NM, PRJCT_SIZE, PBLM_SIZE, STATE,
- RECT_TM, RECT_NUB, CHK_STATE, CHK_PERS_INFO, PLACE_DUTY,
- RECT_PERS_ID, RECT_PERS_NAME,
- DUTY_TRACE, PERS_ID, PERS_NAME, INTM, UPTM, DATA_STAT,
- (case when FILE_ID IS NOT NULL THEN '1' ELSE '0' END )file_State,
- B.FILE_NAME SND_FILE_NAME,B.ID SND_FILE_ID,B.FILE_PATH SND_FILE_PATH
- from
- TAC_PBLM_RECT_ORG A LEFT JOIN GW_COM_FILE B ON A.RECT_ID=B.BIZ_ID where A.ID = #{id}
- </select>
- <select id="getBy" resultMap="tacPblmRectOrgResultMap">
- select
- <include refid="table_columns"/>
- from TAC_PBLM_RECT_ORG
- <include refid="page_where"/>
- </select>
- <select id="findAll" resultMap="tacPblmRectOrgResultMap">
- select
- <include refid="table_columns"/>
- from TAC_PBLM_RECT_ORG
- </select>
- <select id="findList" resultMap="tacPblmRectOrgResultMap">
- select FILE_ID, A.FILE_NAME, A.FILE_PATH,
- RECT_FILE_ID, RECT_FILE_NAME, RECT_FILE_PATH, TITLE, NUB,
- `EXPLAIN`, PRINT_TM, CLOSE_TM, A.ID, RECT_ID, `YEAR`, BATCH,
- RECT_ORG_ID, RECT_ORG_NM, PRJCT_SIZE, PBLM_SIZE, STATE,
- RECT_TM, RECT_NUB, CHK_STATE, CHK_PERS_INFO, PLACE_DUTY,
- RECT_PERS_ID, RECT_PERS_NAME,
- DUTY_TRACE, PERS_ID, PERS_NAME, INTM, UPTM, DATA_STAT,
- (case when FILE_ID IS NOT NULL THEN '1' ELSE '0' END)file_State,
- B.FILE_NAME SND_FILE_NAME,B.ID SND_FILE_ID,B.FILE_PATH SND_FILE_PATH
- from
- TAC_PBLM_RECT_ORG A LEFT JOIN GW_COM_FILE B ON A.RECT_ID=B.BIZ_ID
- <include refid="page_where"/>
- ORDER BY `YEAR`, BATCH
- </select>
- <select id="selectCount" resultType="int">
- select count(ID) from TAC_PBLM_RECT_ORG
- <include refid="page_where"/>
- </select>
- <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.TacPblmRectOrg">
- insert into TAC_PBLM_RECT_ORG(
- <include refid="table_columns"/>
- )
- values (
- <include refid="entity_properties"/>
- )
- </insert>
- <delete id="delete" parameterType="java.lang.String">
- update TAC_PBLM_RECT_ORG set DATA_STAT='9' where ID = #{id}
- </delete>
- <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.TacPblmRectOrg">
- update TAC_PBLM_RECT_ORG set DATA_STAT='9'
- <include refid="page_where"/>
- </delete>
- <update id="deleteInFlag" parameterType="java.lang.String">
- update TAC_PBLM_RECT_ORG set flag_valid = 0 where ID = #{id}
- </update>
- <update id="update" parameterType="cn.com.goldenwater.dcproj.model.TacPblmRectOrg">
- update TAC_PBLM_RECT_ORG
- <trim prefix="set" suffixOverrides=",">
- <if test="fileId != null and fileId != ''">FILE_ID = #{fileId},</if>
- <if test="fileName != null and fileName != ''">FILE_NAME = #{fileName},</if>
- <if test="filePath != null and filePath != ''">FILE_PATH = #{filePath},</if>
- <if test="rectFileId != null and rectFileId != ''">RECT_FILE_ID = #{rectFileId},</if>
- <if test="rectFileName != null and rectFileName != ''">RECT_FILE_NAME = #{rectFileName},</if>
- <if test="rectFilePath != null and rectFilePath != ''">RECT_FILE_PATH = #{rectFilePath},</if>
- <if test="rectId != null and rectId != ''">RECT_ID = #{rectId},</if>
- <if test="year != null and year != ''">`YEAR` = #{year},</if>
- <if test="batch != null and batch != ''">BATCH = #{batch},</if>
- <if test="sndFileId != null and sndFileId != ''">SND_FILE_ID = #{sndFileId},</if>
- <if test="rectOrgId != null and rectOrgId != ''">RECT_ORG_ID = #{rectOrgId},</if>
- <if test="rectOrgNm != null and rectOrgNm != ''">RECT_ORG_NM = #{rectOrgNm},</if>
- <if test="prjctSize != null and prjctSize != ''">PRJCT_SIZE = #{prjctSize},</if>
- <if test="pblmSize != null and pblmSize != ''">PBLM_SIZE = #{pblmSize},</if>
- <if test="state != null and state != ''">STATE = #{state},</if>
- <if test="rectTm != null">RECT_TM = #{rectTm},</if>
- <if test="rectNub != null and rectNub != ''">RECT_NUB = #{rectNub},</if>
- <if test="chkState != null and chkState != ''">CHK_STATE = #{chkState},</if>
- <if test="chkPersInfo != null and chkPersInfo != ''">CHK_PERS_INFO = #{chkPersInfo},</if>
- <if test="placeDuty != null and placeDuty != ''">PLACE_DUTY = #{placeDuty},</if>
- <if test="rectPersId != null and rectPersId != ''">RECT_PERS_ID = #{rectPersId},</if>
- <if test="rectPersName != null and rectPersName != ''">RECT_PERS_NAME = #{rectPersName},</if>
- <if test="dutyTrace != null and dutyTrace != ''">DUTY_TRACE = #{dutyTrace},</if>
- <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
- <if test="persName != null and persName != ''">PERS_NAME = #{persName},</if>
- <if test="intm != null">INTM = #{intm},</if>
- <if test="uptm != null">UPTM = #{uptm},</if>
- <if test="title != null and title != ''">TITLE = #{title},</if>
- <if test="nub != null and nub != ''">NUB = #{nub},</if>
- <if test="explain != null and explain != ''">`EXPLAIN` = #{explain},</if>
- <if test="printTm != null">PRINT_TM = #{printTm},</if>
- <if test="closeTm != null">CLOSE_TM = #{closeTm},</if>
- <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
- </trim>
- <where>ID = #{id}</where>
- </update>
- <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.TacPblmRectOrg">
- update TAC_PBLM_RECT_ORG
- <trim prefix="set" suffixOverrides=",">
- <if test="title != null and title != ''">TITLE = #{title},</if>
- <if test="nub != null and nub != ''">NUB = #{nub},</if>
- <if test="explain != null and explain != ''">`EXPLAIN` = #{explain},</if>
- <if test="printTm != null">PRINT_TM = #{printTm},</if>
- <if test="closeTm != null">CLOSE_TM = #{closeTm},</if>
- </trim>
- <where>RECT_ID = #{rectId}</where>
- </update>
- <!-- 其他自定义SQL -->
- <update id="setFileNull" parameterType="java.lang.String">
- update TAC_PBLM_RECT_ORG set file_id=null,file_path=null,file_name=null where ID = #{id}
- </update>
- <update id="setRectFileNull" parameterType="java.lang.String">
- update TAC_PBLM_RECT_ORG set rect_file_id=null,rect_file_path=null,rect_file_name=null where ID = #{id}
- </update>
- </mapper>
|