318 lines
13 KiB
XML
318 lines
13 KiB
XML
<?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.adc.da.slrs.esRevisePlan.dao.EsRevisePlanDao">
|
|
<sql id="pages">
|
|
<if test=" null != pageSize ">
|
|
LIMIT ${(page-1) * pageSize},${pageSize}
|
|
</if>
|
|
</sql>
|
|
<!-- 基础信息-->
|
|
<sql id="BaseInfo">
|
|
id,
|
|
es_name,
|
|
plan_status,
|
|
revise_status,
|
|
drafter,
|
|
res_person,
|
|
wg_leader,
|
|
draft_time,
|
|
release_time,
|
|
unit,
|
|
rqb_json as rqbJson,
|
|
ts_json as tsJson,
|
|
area,
|
|
qblb,
|
|
(select sar_bussioness_stand.STAND_NAME from sar_bussioness_stand where sar_bussioness_stand.ID = rqb_json )as rqbName,
|
|
(select sar_bussioness_stand.STAND_CODE from sar_bussioness_stand where sar_bussioness_stand.ID = rqb_json )as rqbCode,
|
|
(select group_concat(ts_institution.name) from ts_institution where find_in_set(ts_institution.id,unit)) as unitName,
|
|
(SELECT GROUP_CONCAT(UNAME) from ts_user WHERE find_in_set(USID,drafter) ) as drafterName,
|
|
(SELECT GROUP_CONCAT(DICTIONARY_NAME) from ts_dictionary WHERE find_in_set(ts_dictionary.DICTIONARY_CODE,tsJson) ) as tsJsonName,
|
|
(SELECT GROUP_CONCAT(UNAME) from ts_user WHERE find_in_set(USID,res_person) ) as res_personName,
|
|
(SELECT GROUP_CONCAT(UNAME) from ts_user WHERE find_in_set(USID,wg_leader) ) as wg_leaderName
|
|
</sql>
|
|
|
|
<sql id="BaseInfoList">
|
|
id,
|
|
es_name,
|
|
plan_status,
|
|
revise_status,
|
|
drafter,
|
|
res_person,
|
|
wg_leader,
|
|
draft_time,
|
|
release_time,
|
|
unit,
|
|
rqb_json as rqbJson,
|
|
ts_json as tsJson,
|
|
area,
|
|
qblb,
|
|
(select group_concat(ts_institution.name) from ts_institution where find_in_set(ts_institution.id,unit)) as unitName,
|
|
(SELECT GROUP_CONCAT(UNAME) from ts_user WHERE find_in_set(USID,drafter) ) as drafterName,
|
|
(SELECT GROUP_CONCAT(ts_dictype.DIC_TYPE_NAME) from ts_dictype WHERE find_in_set(ts_dictype.DIC_TYPE_CODE,area) ) as areaName,
|
|
(SELECT GROUP_CONCAT(UNAME) from ts_user WHERE find_in_set(USID,res_person) ) as res_personName,
|
|
(SELECT GROUP_CONCAT(UNAME) from ts_user WHERE find_in_set(USID,wg_leader) ) as wg_leaderName
|
|
</sql>
|
|
<resultMap id="BaseInfoMap" type="com.adc.da.slrs.esRevisePlan.entity.EsRevisePlan">
|
|
<id property="id" column="id"></id>
|
|
<result property="esName" column="es_name"></result>
|
|
<result property="planStatus" column="plan_status"></result>
|
|
<result property="reviseStatus" column="revise_status"></result>
|
|
<result property="drafter" column="drafter"></result>
|
|
<result property="resPerson" column="res_person"></result>
|
|
<result property="wgLeader" column="wg_leader"></result>
|
|
<result property="draftTime" column="draft_time"></result>
|
|
<result property="releaseTime" column="release_time"></result>
|
|
<result property="unit" column="unit"></result>
|
|
<result property="area" column="area"></result>
|
|
<result property="rqbJson" column="rqb_json"></result>
|
|
<result property="tsJson" column="ts_json"></result>
|
|
<result property="qblb" column="qblb"></result>
|
|
<association property="esMatingRelations" javaType="java.util.List" column="id" select="com.adc.da.slrs.esMatingRelation.dao.EsMatingRelationDao.getDatas"/>
|
|
<association property="esStandRelations" javaType="java.util.List" column="id" select="com.adc.da.slrs.esStandRelation.dao.EsStandRelationDao.getDatas"/>
|
|
</resultMap>
|
|
|
|
<resultMap id="BaseInfoMapList" type="com.adc.da.slrs.esRevisePlan.entity.EsRevisePlan">
|
|
<id property="id" column="id"></id>
|
|
<result property="esName" column="es_name"></result>
|
|
<result property="planStatus" column="plan_status"></result>
|
|
<result property="reviseStatus" column="revise_status"></result>
|
|
<result property="drafter" column="drafter"></result>
|
|
<result property="resPerson" column="res_person"></result>
|
|
<result property="wgLeader" column="wg_leader"></result>
|
|
<result property="draftTime" column="draft_time"></result>
|
|
<result property="releaseTime" column="release_time"></result>
|
|
<result property="unit" column="unit"></result>
|
|
<result property="area" column="area"></result>
|
|
<result property="rqbJson" column="rqb_json"></result>
|
|
<result property="tsJson" column="ts_json"></result>
|
|
<result property="qblb" column="qblb"></result>
|
|
<!--<association property="esMatingRelations" javaType="java.util.List" column="id" select="com.adc.da.slrs.esMatingRelation.dao.EsMatingRelationDao.getDatas"/>-->
|
|
<!--<association property="esStandRelations" javaType="java.util.List" column="id" select="com.adc.da.slrs.esStandRelation.dao.EsStandRelationDao.getDatas"/>-->
|
|
</resultMap>
|
|
<!-- 查询条件-->
|
|
<sql id="Conditions">
|
|
<where>
|
|
<if test="esName != null and esName != ''">
|
|
and es_name like concat('%',#{esName},'%')
|
|
</if>
|
|
<if test="area != null and area != ''">
|
|
and area = #{area}
|
|
</if>
|
|
<if test="qblb != null and qblb != ''">
|
|
and qblb = #{qblb}
|
|
</if>
|
|
<if test="planStatus != null and planStatus != ''">
|
|
and plan_status = #{planStatus}
|
|
</if>
|
|
<if test="reviseStatus != null and reviseStatus != ''">
|
|
and revise_status = #{reviseStatus}
|
|
</if>
|
|
<if test="drafter != null and drafter != ''">
|
|
and drafter = #{drafter}
|
|
</if>
|
|
<if test="resPerson != null and resPerson != ''">
|
|
and res_person = #{resPerson}
|
|
</if>
|
|
<if test="wgLeader != null and wgLeader != ''">
|
|
and wg_leader = #{wgLeader}
|
|
</if>
|
|
<if test="draftTime != null">
|
|
and DATE_FORMAT(draft_time,'%Y-%m-%d')=DATE_FORMAT(#{draftTime},'%Y-%m-%d')
|
|
</if>
|
|
<if test="releaseTime != null">
|
|
and DATE_FORMAT(release_time,'%Y-%m-%d')=DATE_FORMAT(#{releaseTime},'%Y-%m-%d')
|
|
</if>
|
|
<if test="unit != null and unit != ''">
|
|
and unit like concat('%',#{unit},'%')
|
|
</if>
|
|
</where>
|
|
</sql>
|
|
<select id="getTotal" resultType="java.lang.Integer" >
|
|
select count(*) from es_revise_plan
|
|
</select>
|
|
<select id="getQueryTotal" parameterType="com.adc.da.slrs.esRevisePlan.entity.EsRevisePlan" resultType="java.lang.Integer" >
|
|
select count(*) from es_revise_plan
|
|
<include refid="Conditions"></include>
|
|
</select>
|
|
<!-- 查询所有-->
|
|
<select id="selectAll" resultMap="BaseInfoMapList" >
|
|
select <include refid="BaseInfoList"></include> from es_revise_plan
|
|
<include refid="pages">
|
|
</include>
|
|
</select>
|
|
<!-- 多条件查询-->
|
|
<select id="queryAll" parameterType="com.adc.da.slrs.esRevisePlan.entity.EsRevisePlan" resultMap="BaseInfoMapList">
|
|
select <include refid="BaseInfoList"></include> from es_revise_plan
|
|
<include refid="Conditions">
|
|
</include>
|
|
<include refid="pages">
|
|
</include>
|
|
</select>
|
|
<!-- 查询详情-->
|
|
<select id="selectOne" parameterType="java.lang.String" resultMap="BaseInfoMap">
|
|
select <include refid="BaseInfo"></include> from es_revise_plan
|
|
where id = #{id}
|
|
</select>
|
|
<!-- 修改-->
|
|
<update id="updateOne" parameterType="com.adc.da.slrs.esRevisePlan.entity.EsRevisePlan">
|
|
update es_revise_plan
|
|
<set>
|
|
<if test="id != null and id != ''">
|
|
id = #{id},
|
|
</if>
|
|
<if test="esName != null and esName != ''">
|
|
es_name = #{esName},
|
|
</if>
|
|
<if test="planStatus != null and planStatus != ''">
|
|
plan_status = #{planStatus},
|
|
</if>
|
|
<if test="reviseStatus != null and reviseStatus != ''">
|
|
revise_status = #{reviseStatus},
|
|
</if>
|
|
<if test="drafter != null and drafter != ''">
|
|
drafter = #{drafter},
|
|
</if>
|
|
<if test="resPerson != null and resPerson != ''">
|
|
res_person = #{resPerson},
|
|
</if>
|
|
<if test="wgLeader != null and wgLeader != ''">
|
|
wg_leader = #{wgLeader},
|
|
</if>
|
|
<if test="draftTime != null">
|
|
draft_time = #{draftTime},
|
|
</if>
|
|
<if test="releaseTime != null">
|
|
release_time = #{releaseTime},
|
|
</if>
|
|
<if test="unit != null and unit != ''">
|
|
unit = #{unit},
|
|
</if>
|
|
<if test="rqbJson != null and rqbJson != ''">
|
|
rqb_json=#{rqbJson}
|
|
</if>
|
|
<if test="tsJson != null and tsJson != ''">
|
|
ts_json=#{tsJson}
|
|
</if>
|
|
<if test="area != null and area != ''">
|
|
area=#{area}
|
|
</if>
|
|
<if test="qblb != null and qblb != ''">
|
|
qblb=#{qblb}
|
|
</if>
|
|
</set>
|
|
where id = #{id}
|
|
</update>
|
|
<!-- 插入一条数据-->
|
|
<insert id="insertOne" parameterType="com.adc.da.slrs.esRevisePlan.entity.EsRevisePlan">
|
|
insert into es_revise_plan
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="id != null and id != ''">
|
|
id,
|
|
</if>
|
|
<if test="esName != null and esName != ''">
|
|
es_name,
|
|
</if>
|
|
<if test="planStatus != null and planStatus != ''">
|
|
plan_status,
|
|
</if>
|
|
<if test="reviseStatus != null and reviseStatus != ''">
|
|
revise_status,
|
|
</if>
|
|
<if test="drafter != null and drafter != ''">
|
|
drafter,
|
|
</if>
|
|
<if test="resPerson != null and resPerson != ''">
|
|
res_person,
|
|
</if>
|
|
<if test="wgLeader != null and wgLeader != ''">
|
|
wg_leader,
|
|
</if>
|
|
<if test="draftTime != null">
|
|
draft_time,
|
|
</if>
|
|
<if test="releaseTime != null">
|
|
release_time,
|
|
</if>
|
|
<if test="unit != null and unit != ''">
|
|
unit,
|
|
</if>
|
|
<if test="rqbJson != null and rqbJson != ''">
|
|
rqb_json,
|
|
</if>
|
|
<if test="tsJson != null and tsJson != ''">
|
|
ts_json,
|
|
</if>
|
|
<if test="area != null and area != ''">
|
|
area,
|
|
</if>
|
|
<if test="qblb != null and qblb != ''">
|
|
qblb,
|
|
</if>
|
|
</trim>
|
|
values
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="id != null and id != ''">
|
|
#{id},
|
|
</if>
|
|
<if test="esName != null and esName != ''">
|
|
#{esName},
|
|
</if>
|
|
<if test="planStatus != null and planStatus != ''">
|
|
#{planStatus},
|
|
</if>
|
|
<if test="reviseStatus != null and reviseStatus != ''">
|
|
#{reviseStatus},
|
|
</if>
|
|
<if test="drafter != null and drafter != ''">
|
|
#{drafter},
|
|
</if>
|
|
<if test="resPerson != null and resPerson != ''">
|
|
#{resPerson},
|
|
</if>
|
|
<if test="wgLeader != null and wgLeader != ''">
|
|
#{wgLeader},
|
|
</if>
|
|
<if test="draftTime != null">
|
|
#{draftTime},
|
|
</if>
|
|
<if test="releaseTime != null">
|
|
#{releaseTime},
|
|
</if>
|
|
<if test="unit != null and unit != ''">
|
|
#{unit},
|
|
</if>
|
|
<if test="rqbJson != null and rqbJson != ''">
|
|
#{rqbJson},
|
|
</if>
|
|
<if test="tsJson != null and tsJson != ''">
|
|
#{tsJson},
|
|
</if>
|
|
<if test="area != null and area != ''">
|
|
#{area},
|
|
</if>
|
|
<if test="qblb != null and qblb != ''">
|
|
#{qblb},
|
|
</if>
|
|
</trim>
|
|
</insert>
|
|
<!-- 删除-->
|
|
<delete id="deleteOne" parameterType="java.lang.String">
|
|
delete from es_revise_plan where id = #{id}
|
|
</delete>
|
|
<!-- 批量删除-->
|
|
<delete id="deleteBatch" parameterType="java.lang.String">
|
|
delete from es_revise_plan where id in
|
|
<foreach collection="array" item="id" open="(" close=")" separator=",">
|
|
#{id}
|
|
</foreach>
|
|
</delete>
|
|
|
|
<select id="selectPageByName" resultMap="BaseInfoMap">
|
|
select <include refid="BaseInfo"></include> from es_revise_plan
|
|
where es_name = #{esName}
|
|
<if test="id != null and id != '' ">
|
|
and id != #{id}
|
|
</if>
|
|
</select>
|
|
</mapper>
|