| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502 |
- <?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.ObjInspPblmsDao">
- <resultMap type="cn.com.goldenwater.dcproj.model.ObjInspPblms" id="objInspPblmsResultMap">
- <result property="type" column="TYPE"/>
- <result property="objInspPblms" column="OBJ_INSP_PBLMS"/>
- <result property="guid" column="GUID"/>
- <result property="pguid" column="PGUID"/>
- <result property="sn" column="SN"/>
- <result property="inspPblmsName" column="INSP_PBLMS_NAME"/>
- <result property="inspObjType" column="INSP_OBJ_TYPE"/>
- <result property="sort1" column="SORT1"/>
- <result property="sort2" column="SORT2"/>
- <result property="relBasis" column="REL_BASIS"/>
- <result property="checkPoint" column="CHECK_POINT"/>
- <result property="inspPblmCate" column="INSP_PBLM_CATE"/>
- <result property="pblmDesc" column="PBLM_DESC"/>
- <result property="dataStat" column="DATA_STAT"/>
- <result property="collTime" column="COLL_TIME"/>
- <result property="recPers" column="REC_PERS"/>
- <result property="note" column="NOTE"/>
- <result property="attach" column="ATTACH"/>
- <result property="snClass" column="SN_CLASS"/>
- <result property="snNum" column="SN_NUM"/>
- <result property="orgId" column="ORG_ID"/>
- <result property="score" column="SCORE"/>
- </resultMap>
- <sql id="table_columns">
- SN_CLASS,
- ATTACH,
- TYPE ,
- OBJ_INSP_PBLMS ,
- GUID ,
- PGUID ,
- SN ,
- INSP_PBLMS_NAME ,
- INSP_OBJ_TYPE ,
- SORT1 ,
- SORT2 ,
- REL_BASIS ,
- CHECK_POINT ,
- PBLM_DESC ,
- INSP_PBLM_CATE ,
- DATA_STAT ,
- COLL_TIME ,
- REC_PERS ,
- NOTE,ORG_ID,SCORE
- </sql>
- <sql id="table_columns2">
- SN_CLASS,
- ATTACH,
- TYPE ,
- OBJ_INSP_PBLMS ,
- GUID ,
- PGUID ,
- SN ,
- INSP_PBLMS_NAME ,
- INSP_OBJ_TYPE ,
- SORT1 ,
- SORT2 ,
- REL_BASIS ,
- CHECK_POINT ,
- PBLM_DESC ,
- INSP_PBLM_CATE ,
- DATA_STAT ,
- COLL_TIME ,
- REC_PERS ,
- NOTE,ORG_ID,SCORE
- </sql>
- <sql id="entity_properties">
- #{snClass},
- #{attach},
- #{type},
- #{objInspPblms},
- #{guid},
- #{pguid},
- #{sn},
- #{inspPblmsName},
- #{inspObjType},
- #{sort1},
- #{sort2},
- #{relBasis},
- #{checkPoint},
- #{pblmDesc},
- #{inspPblmCate},
- #{dataStat},
- #{collTime},
- #{recPers},
- #{note},#{orgId},#{score}
- </sql>
- <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
- <sql id="page_where">
- <trim prefix="where" prefixOverrides="and | or ">
- <if test="type != null and type != ''">and TYPE = #{type}</if>
- <if test="objInspPblms != null and objInspPblms != ''">and OBJ_INSP_PBLMS = #{objInspPblms}</if>
- <if test="guid != null and guid != ''">and GUID = #{guid}</if>
- <if test="pguid != null and pguid != ''">and PGUID = #{pguid}</if>
- <if test="sn != null and sn != ''">and SN = #{sn}</if>
- <if test="inspPblmsName != null and inspPblmsName != ''">and INSP_PBLMS_NAME = #{inspPblmsName}</if>
- <if test="inspObjType != null and inspObjType != ''">and INSP_OBJ_TYPE = #{inspObjType}</if>
- <if test="sort1 != null and sort1 != ''">and SORT1 = #{sort1}</if>
- <if test="sort2 != null and sort2 != ''">and SORT2 = #{sort2}</if>
- <if test="relBasis != null and relBasis != ''">and REL_BASIS = #{relBasis}</if>
- <if test="checkPoint != null and checkPoint != ''">and CHECK_POINT like '%${checkPoint}%'</if>
- <if test="pblmDesc != null and pblmDesc != ''">and PBLM_DESC = #{pblmDesc}</if>
- <if test="inspPblmCate != null and inspPblmCate != ''">and INSP_PBLM_CATE = #{inspPblmCate}</if>
- <if test="dataStat != null and dataStat != ''">and DATA_STAT = #{dataStat}</if>
- <if test="collTime != null and collTime != ''">and COLL_TIME = #{collTime}</if>
- <if test="recPers != null and recPers != ''">and REC_PERS = #{recPers}</if>
- <if test="note != null and note != ''">and NOTE = #{note}</if>
- <if test="attach != null and attach != ''">and ATTACH = #{attach}</if>
- <if test="snClass != null and snClass != ''">and SN_CLASS = #{snClass}</if>
- <if test="snNum != null and snNum != ''">and SN_NUM = #{snNum}</if>
- <if test="sheet != null and sheet != ''">AND sheet = #{sheet}</if>
- </trim>
- </sql>
- <select id="findLastVersion" resultType="cn.com.goldenwater.dcproj.dto.DictDto" parameterType="String">
- select * from GW_SYS_DICT t where 1=1
- <if test="name !=null and name !=''">
- AND t.name=#{name}
- </if>
- </select>
- <select id="get" resultMap="objInspPblmsResultMap" parameterType="String">
- select
- <include refid="table_columns"/>
- from OBJ_INSP_PBLMS where GUID = #{id}
- </select>
- <select id="getBy" resultMap="objInspPblmsResultMap">
- select
- <include refid="table_columns"/>
- from OBJ_INSP_PBLMS
- <include refid="page_where"/>
- </select>
- <select id="findAll" resultMap="objInspPblmsResultMap">
- select
- <include refid="table_columns"/>
- from OBJ_INSP_PBLMS
- </select>
- <select id="findList" resultMap="objInspPblmsResultMap">
- select
- <include refid="table_columns"/>
- from OBJ_INSP_PBLMS
- <where>
- <if test="type != null and type != ''">and TYPE = #{type}</if>
- <if test="objInspPblms != null and objInspPblms != ''">and OBJ_INSP_PBLMS = #{objInspPblms}</if>
- <if test="guid != null and guid != ''">and GUID = #{guid}</if>
- <if test="pguid != null and pguid != ''">and PGUID = #{pguid}</if>
- <if test="sn != null and sn != ''">and SN = #{sn}</if>
- <if test="inspPblmsName != null and inspPblmsName != ''">and INSP_PBLMS_NAME = #{inspPblmsName}</if>
- <if test="inspObjType != null and inspObjType != ''">and INSP_OBJ_TYPE = #{inspObjType}</if>
- <if test="sort1 != null and sort1 != ''">and SORT1 = #{sort1}</if>
- <if test="sort2 != null and sort2 != ''">and SORT2 = #{sort2}</if>
- <if test="relBasis != null and relBasis != ''">and REL_BASIS = #{relBasis}</if>
- <if test="checkPoint != null and checkPoint != ''">and CHECK_POINT like '%${checkPoint}%'</if>
- <if test="pblmDesc != null and pblmDesc != ''">and PBLM_DESC = #{pblmDesc}</if>
- <if test="inspPblmCate != null and inspPblmCate != ''">and INSP_PBLM_CATE = #{inspPblmCate}</if>
- <if test="dataStat != null and dataStat != ''">and DATA_STAT = #{dataStat}</if>
- <if test="collTime != null and collTime != ''">and COLL_TIME = #{collTime}</if>
- <if test="recPers != null and recPers != ''">and REC_PERS = #{recPers}</if>
- <if test="note != null and note != ''">and NOTE = #{note}</if>
- <if test="attach != null and attach != ''">and ATTACH = #{attach}</if>
- <if test="snClass != null and snClass != ''">and SN_CLASS = #{snClass}</if>
- <if test="snNum != null and snNum != ''">and SN_NUM = #{snNum}</if>
- <if test="sheet != null and sheet != ''">AND sheet = #{sheet}</if>
- <choose>
- <when test="orgId!=null and orgId !=''">
- AND ORG_ID = #{orgId}
- </when>
- <otherwise>
- AND ORG_ID IS NULL
- </otherwise>
- </choose>
- </where>
- </select>
- <select id="selectCount" resultType="int">
- select count(GUID) from OBJ_INSP_PBLMS
- <include refid="page_where"/>
- </select>
- <select id="findPblmsDTO" resultType="cn.com.goldenwater.dcproj.dto.ObjInspPblmsDto">
- select s.guid,s.insp_pblms_name,s.check_point,s.insp_pblm_cate,s.pblm_desc,s.sn_num from obj_insp_pblms s where
- s.type=#{type} and s.data_stat ='1'
- <choose>
- <when test="orgId!=null and orgId !=''">
- and s.org_id=#{orgId}
- </when>
- <otherwise>
- and s.org_id is null
- </otherwise>
- </choose>
- <if test="pblmsName != null and pblmsName != ''">
- and s.pblm_desc like concat('%',concat(#{pblmsName},'%'))
- </if>
- order by s.attach asc,s.sn_num asc
- </select>
- <select id="findPblmsDtoName" resultType="cn.com.goldenwater.dcproj.dto.ObjInspPblmsDto">
- select w.insp_pblms_name from (
- select distinct insp_pblms_name,s.attach,s.sort1 from obj_insp_pblms s
- where type=#{type} and s.data_stat ='1'
- <choose>
- <when test="orgId!=null and orgId !=''">
- and s.org_id=#{orgId}
- </when>
- <otherwise>
- and s.org_id is null
- </otherwise>
- </choose>
- <if test="pblmsName != null and pblmsName != ''">
- and s.pblm_desc like concat('%',concat(#{pblmsName},'%'))
- </if>
- and sort1 is not null order by s.attach asc,sort1 asc
- ) w
- </select>
- <select id="findPblmsName" resultType="java.lang.String">
- select w.insp_pblms_name from (
- select distinct insp_pblms_name,s.attach from obj_insp_pblms s where type=1 and sort1 is not null order by s.attach asc
- ) w
- </select>
- <select id="getPblmNames" resultType="java.lang.String"
- parameterType="cn.com.goldenwater.dcproj.param.ObjInspPblmsParam">
- SELECT DISTINCT INSP_PBLMS_NAME FROM OBJ_INSP_PBLMS WHERE 1 = 1
- <if test="type != null and type != ''">and type = #{type}</if>
- <choose>
- <when test="orgId != null and orgId != ''">
- AND org_id = #{orgId}
- </when>
- <otherwise>
- AND org_id is null
- </otherwise>
- </choose>
- </select>
- <select id="findWagaPblm" resultMap="objInspPblmsResultMap" parameterType="java.lang.String">
- select * from obj_insp_pblms s where s.attach=#{attach} and type=6
- and s.sn in (${sn}) and s.data_stat ='1'
- </select>
- <select id="findPblmsCheckPoints" resultType="java.lang.String"
- parameterType="cn.com.goldenwater.dcproj.param.ObjInspPblmsParam">
- select distinct check_point from obj_insp_pblms s where s.type=#{type}
- <if test="inspPblmsName != null and inspPblmsName != ''">
- and s.insp_pblms_name=#{inspPblmsName}
- </if>
- <choose>
- <when test="orgId != null and orgId != ''">
- AND org_id = #{orgId}
- </when>
- <otherwise>
- AND org_id is null
- </otherwise>
- </choose>
- and
- s.attach in ('1','2') and s.data_stat ='1'
- </select>
- <select id="findPblmsDesc" resultType="java.lang.String" parameterType="java.util.Map">
- select pblm_desc from obj_insp_pblms s where s.check_point=#{checkPoint} and s.type=#{type}
- <if test="inspPblmsName != null and inspPblmsName != ''">
- and s.insp_pblms_name=#{inspPblmsName}
- </if>
- <choose>
- <when test="orgId != null and orgId != ''">
- AND org_id = #{orgId}
- </when>
- <otherwise>
- AND org_id is null
- </otherwise>
- </choose>
- and s.data_stat ='1' and s.attach in ('1','2') order by sort2 asc
- </select>
- <select id="getByPblms" resultMap="objInspPblmsResultMap" parameterType="java.util.Map">
- select * from obj_insp_pblms s where s.insp_pblms_name=#{inspPblmsName} and s.type=#{type} and
- s.check_point=#{checkPoint}
- <choose>
- <when test="orgId != null and orgId != ''">
- AND org_id = #{orgId}
- </when>
- <otherwise>
- AND org_id is null
- </otherwise>
- </choose>
- and s.pblm_desc like '${pblmDesc}' and s.attach in ('1','2')
- order by sort2 asc
- </select>
- <select id="getPblmsByType" resultMap="objInspPblmsResultMap"
- parameterType="cn.com.goldenwater.dcproj.param.ObjInspPblmsParam">
- select * from obj_insp_pblms s where s.type=#{type}
- <if test="inspPblmsName != null and inspPblmsName != ''">
- and s.insp_pblms_name=#{inspPblmsName}
- </if>
- and
- s.check_point=#{checkPoint} and s.data_stat ='1'
- <choose>
- <when test="orgId != null and orgId != ''">
- AND org_id = #{orgId}
- </when>
- <otherwise>
- AND org_id is null
- </otherwise>
- </choose>
- <if test="pblmDesc !=null and pblmDesc !=''">
- and s.pblm_desc like concat('%',concat(#{pblmDesc},'%'))
- </if>
- and s.attach in ('1','2')
- order by sort2 asc
- </select>
- <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.ObjInspPblms">
- insert into OBJ_INSP_PBLMS(
- <include refid="table_columns2"/>
- )
- values (
- <include refid="entity_properties"/>
- )
- </insert>
- <delete id="delete" parameterType="java.lang.String">
- delete from OBJ_INSP_PBLMS where GUID = #{id}
- </delete>
- <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.ObjInspPblms">
- delete from OBJ_INSP_PBLMS
- <include refid="page_where"/>
- </delete>
- <update id="deleteInFlag" parameterType="java.lang.String">
- update OBJ_INSP_PBLMS set flag_valid = 0 where GUID = #{id}
- </update>
- <update id="update" parameterType="cn.com.goldenwater.dcproj.model.ObjInspPblms">
- update OBJ_INSP_PBLMS
- <trim prefix="set" suffixOverrides=",">
- <if test="type != null and type != ''">TYPE = #{type},</if>
- <if test="objInspPblms != null and objInspPblms != ''">OBJ_INSP_PBLMS = #{objInspPblms},</if>
- <if test="guid != null and guid != ''">GUID = #{guid},</if>
- <if test="pguid != null and pguid != ''">PGUID = #{pguid},</if>
- <if test="sn != null and sn != ''">SN = #{sn},</if>
- <if test="inspPblmsName != null and inspPblmsName != ''">INSP_PBLMS_NAME = #{inspPblmsName},</if>
- <if test="inspObjType != null and inspObjType != ''">INSP_OBJ_TYPE = #{inspObjType},</if>
- <if test="sort1 != null and sort1 != ''">SORT1 = #{sort1},</if>
- <if test="sort2 != null and sort2 != ''">SORT2 = #{sort2},</if>
- <if test="relBasis != null and relBasis != ''">REL_BASIS = #{relBasis},</if>
- <if test="checkPoint != null and checkPoint != ''">CHECK_POINT = #{checkPoint},</if>
- <if test="pblmDesc != null and pblmDesc != ''">PBLM_DESC = #{pblmDesc},</if>
- <if test="inspPblmCate != null and inspPblmCate != ''">INSP_PBLM_CATE = #{inspPblmCate},</if>
- <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
- <if test="collTime != null and collTime != ''">COLL_TIME = #{collTime},</if>
- <if test="recPers != null and recPers != ''">REC_PERS = #{recPers},</if>
- <if test="note != null and note != ''">NOTE = #{note},</if>
- <if test="attach != null and attach != ''">ATTACH = #{attach},</if>
- <if test="snClass != null and snClass != ''">SN_CLASS = #{snClass},</if>
- </trim>
- <where>GUID = #{guid}</where>
- </update>
- <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.ObjInspPblms">
- update OBJ_INSP_PBLMS
- <trim prefix="set" suffixOverrides=",">
- <if test="type != null and type != ''">TYPE = #{type},</if>
- <if test="objInspPblms != null and objInspPblms != ''">OBJ_INSP_PBLMS = #{objInspPblms},</if>
- <if test="guid != null and guid != ''">GUID = #{guid},</if>
- <if test="pguid != null and pguid != ''">PGUID = #{pguid},</if>
- <if test="sn != null and sn != ''">SN = #{sn},</if>
- <if test="inspPblmsName != null and inspPblmsName != ''">INSP_PBLMS_NAME = #{inspPblmsName},</if>
- <if test="inspObjType != null and inspObjType != ''">INSP_OBJ_TYPE = #{inspObjType},</if>
- <if test="sort1 != null and sort1 != ''">SORT1 = #{sort1},</if>
- <if test="sort2 != null and sort2 != ''">SORT2 = #{sort2},</if>
- <if test="relBasis != null and relBasis != ''">REL_BASIS = #{relBasis},</if>
- <if test="checkPoint != null and checkPoint != ''">CHECK_POINT = #{checkPoint},</if>
- <if test="pblmDesc != null and pblmDesc != ''">PBLM_DESC = #{pblmDesc},</if>
- <if test="inspPblmCate != null and inspPblmCate != ''">INSP_PBLM_CATE = #{inspPblmCate},</if>
- <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
- <if test="collTime != null and collTime != ''">COLL_TIME = #{collTime},</if>
- <if test="recPers != null and recPers != ''">REC_PERS = #{recPers},</if>
- <if test="note != null and note != ''">NOTE = #{note},</if>
- <if test="attach != null and attach != ''">ATTACH = #{attach},</if>
- <if test="snClass != null and snClass != ''">SN_CLASS = #{snClass},</if>
- </trim>
- <include refid="page_where"/>
- </update>
- <!-- 其他自定义SQL -->
- <select id="getPblmsTypeBySnAttType" resultType="java.util.Map" parameterType="java.util.Map">
- select distinct ATTACH,SHEET,SORT1,INSP_PBLMS_NAME from OBJ_INSP_PBLMS WHERE 1=1
- <if test="type != null and type != ''">AND TYPE = #{type}</if>
- <if test="fileNum != null and fileNum != ''">AND attach = #{fileNum}</if>
- <choose>
- <when test="orgId != null and orgId != ''">
- AND org_id = #{orgId}
- </when>
- <otherwise>
- AND org_id is null
- </otherwise>
- </choose>
- <if test="sheetNum != null and sheetNum != ''">AND sheet = #{sheetNum}</if>
- <if test="snList != null and snList.size > 0">
- and sn_num in
- <foreach collection="snList" index="index" item="item" open="(" separator="," close=")">
- ${item}
- </foreach>
- </if>
- order by attach,sheet,sort1
- </select>
- <select id="getPblmsCheckBySnAttType" resultType="java.util.Map" parameterType="java.util.Map">
- select distinct ATTACH,SHEET,SORT1,SORT2,CHECK_POINT from OBJ_INSP_PBLMS WHERE data_stat ='1'
- <if test="type != null and type != ''">AND TYPE = #{type}</if>
- <if test="fileNum != null and fileNum != ''">AND attach = #{fileNum}</if>
- <if test="sort1 != null and sort1 != ''">AND sort1 = #{sort1}</if>
- <choose>
- <when test="orgId != null and orgId != ''">
- AND org_id = #{orgId}
- </when>
- <otherwise>
- AND org_id is null
- </otherwise>
- </choose>
- <if test="snList != null and snList.size > 0">
- and sn_num in
- <foreach collection="snList" index="index" item="item" open="(" separator="," close=")">
- ${item}
- </foreach>
- </if>
- order by attach,sheet,sort1,sort2
- </select>
- <select id="getPblmsBySnAttTypeSort" resultType="cn.com.goldenwater.dcproj.model.ObjInspPblms"
- parameterType="java.util.Map">
- select * from OBJ_INSP_PBLMS WHERE data_stat ='1'
- <if test="type != null and type != ''">AND TYPE = #{type}</if>
- <if test="fileNum != null and fileNum != ''">AND attach = #{fileNum}</if>
- <if test="sort1 != null and sort1 != ''">AND sort1 = #{sort1}</if>
- <if test="orgId != null and orgId != ''">AND org_id = #{orgId}</if>
- <choose>
- <when test="orgId != null and orgId != ''">
- AND org_id = #{orgId}
- </when>
- <otherwise>
- AND org_id is null
- </otherwise>
- </choose>
- <if test="sort2 != null and sort2 != ''">AND sort2 = #{sort2}</if>
- <if test="snList != null and snList.size > 0">
- and sn_num in
- <foreach collection="snList" index="index" item="item" open="(" separator="," close=")">
- ${item}
- </foreach>
- </if>
- order by sn_num
- </select>
- <select id="getPblmIdsList" resultType="java.lang.String" parameterType="java.util.HashMap">
- select GUID from OBJ_INSP_PBLMS WHERE data_stat ='1'
- <if test="type != null and type != ''">AND TYPE = #{type}</if>
- <if test="fileNum != null and fileNum != ''">AND attach = #{fileNum}</if>
- <if test="sort1 != null and sort1 != ''">AND sort1 = #{sort1}</if>
- <choose>
- <when test="orgId != null and orgId != ''">
- AND ORG_ID = #{orgId}
- </when>
- <otherwise>
- AND ORG_ID is null
- </otherwise>
- </choose>
- <if test="snList != null and snList.size > 0">
- and sn_num in
- <foreach collection="snList" index="index" item="item" open="(" separator="," close=")">
- ${item}
- </foreach>
- </if>
- </select>
- <select id="selectIndexList" resultMap="objInspPblmsResultMap">
- select GUID , TYPE , INSP_PBLMS_NAME ,SORT1 , SORT2 , CHECK_POINT , PBLM_DESC , INSP_PBLM_CATE ,SN_NUM
- from OBJ_INSP_PBLMS
- where TYPE in
- <foreach collection="list" index="index" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- order by cast(SN_NUM as unsigned )
- </select>
- </mapper>
|