Files
foton-slrs-system-rest/adc-da-slrs/src/main/resources/mybatis/mapper/wgdCensusLeo/WgdWbxdMapper.xml
T
2021-12-03 11:29:49 +08:00

324 lines
12 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.wgdCensusLeo.dao.WgdWbxdDao">
<!-- 基础信息-->
<sql id="BaseInfo">
id,stage,number,name,project_id,project_name,type,preside,data_start,data_implement,body,drafting,data_record,report,participants,celebrity,cost_marking,cost_other,revised,status,signature,remark
</sql>
<!-- 查询条件-->
<sql id="Conditions">
<where>
<if test="id != null and id != ''">
and id = #{id}
</if>
<if test="stage != null and stage != ''">
and stage like concat('%',#{stage},'%')
</if>
<if test="number != null and number != ''">
and number like concat('%',#{number},'%')
</if>
<if test="name != null and name != ''">
and name like concat('%',#{name},'%')
</if>
<if test="project_id != null and project_id != ''">
and project_id = #{projectId}
</if>
<if test="project_name != null and project_name != ''">
and project_name = #{project_name}
</if>
<if test="type != null and type != ''">
and type = #{type}
</if>
<if test="preside != null and preside != ''">
and preside = #{preside}
</if>
<if test="data_start != null and data_start != ''">
and data_start = #{data_start}
</if>
<if test="data_implement != null and data_implement != ''">
and data_implement = #{data_implement}
</if>
<if test="body != null and body != ''">
and body = #{body}
</if>
<if test="drafting != null and drafting != ''">
and drafting = #{drafting}
</if>
<if test="data_record != null and data_record != ''">
and data_record = #{data_record}
</if>
<if test="report != null and report != ''">
and report = #{report}
</if>
<if test="participants != null and participants != ''">
and participants = #{participants}
</if>
<if test="celebrity != null and celebrity != ''">
and celebrity = #{celebrity}
</if>
<if test="cost_marking != null and cost_marking != ''">
and cost_marking = #{cost_marking}
</if>
<if test="cost_other != null and cost_other != ''">
and cost_other = #{cost_other}
</if>
<if test="revised != null and revised != ''">
and revised = #{revised}
</if>
<if test="status != null and status != ''">
and status = #{status}
</if>
<if test="signature != null and signature != ''">
and signature = #{signature}
</if>
<if test="remark != null and remark != ''">
and remark = #{remark}
</if>
</where>
</sql>
<select id="getTotal" resultType="java.lang.Integer">
select count(*) from wgd_wbxd
</select>
<select id="getQueryTotal" parameterType="com.adc.da.slrs.wgdCensusLeo.entity.WgdWbxd" resultType="java.lang.Integer">
select count(*) from wgd_wbxd
<include refid="Conditions"></include>
</select>
<!-- 查询所有-->
<select id="selectAll" resultType="com.adc.da.slrs.wgdCensusLeo.entity.WgdWbxd">
select <include refid="BaseInfo"></include> from wgd_wbxd
</select>
<!-- 多条件查询-->
<select id="queryAll" parameterType="com.adc.da.slrs.wgdCensusLeo.entity.WgdWbxd" resultType="com.adc.da.slrs.wgdCensusLeo.entity.WgdWbxd">
select <include refid="BaseInfo"></include> from wgd_wbxd
<include refid="Conditions"></include>
</select>
<!-- 查询详情-->
<select id="selectOne" parameterType="java.lang.String" resultType="com.adc.da.slrs.wgdCensusLeo.entity.WgdWbxd">
select <include refid="BaseInfo"></include> from wgd_wbxd
where id = #{id}
</select>
<!-- 修改-->
<update id="updateOne" parameterType="com.adc.da.slrs.wgdCensusLeo.entity.WgdWbxd">
update wgd_wbxd
<set>
<if test="stage != null and stage != ''">
stage = #{stage},
</if>
<if test="number != null and number != ''">
number = #{number},
</if>
<if test="name != null and name != ''">
name = #{name},
</if>
<if test="project_id != null and project_id != ''">
project_id = #{projectId},
</if>
<if test="project_name != null and project_name != ''">
project_name = #{project_name},
</if>
<if test="type != null and type != ''">
type = #{type},
</if>
<if test="preside != null and preside != ''">
preside = #{preside},
</if>
<if test="data_start != null and data_start != ''">
data_start = #{data_start},
</if>
<if test="data_implement != null and data_implement != ''">
data_implement = #{data_implement},
</if>
<if test="body != null and body != ''">
body = #{body},
</if>
<if test="drafting != null and drafting != ''">
drafting = #{drafting},
</if>
<if test="data_record != null and data_record != ''">
data_record = #{data_record},
</if>
<if test="report != null and report != ''">
report = #{report},
</if>
<if test="participants != null and participants != ''">
participants = #{participants},
</if>
<if test="celebrity != null and celebrity != ''">
celebrity = #{celebrity},
</if>
<if test="cost_marking != null and cost_marking != ''">
cost_marking = #{cost_marking},
</if>
<if test="cost_other != null and cost_other != ''">
cost_other = #{cost_other},
</if>
<if test="revised != null and revised != ''">
revised = #{revised},
</if>
<if test="status != null and status != ''">
status = #{status},
</if>
<if test="signature != null and signature != ''">
signature = #{signature},
</if>
<if test="remark != null and remark != ''">
remark = #{remark},
</if>
</set>
where id = #{id}
</update>
<!-- 插入一条数据-->
<insert id="insertOne" parameterType="com.adc.da.slrs.wgdCensusLeo.entity.WgdWbxd">
insert into wgd_wbxd
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null and id != ''">
id,
</if>
<if test="stage != null and stage != ''">
stage,
</if>
<if test="number != null and number != ''">
number,
</if>
<if test="name != null and name != ''">
name,
</if>
<if test="project_id != null and project_id != ''">
project_id,
</if>
<if test="project_name != null and project_name != ''">
project_name,
</if>
<if test="type != null and type != ''">
type,
</if>
<if test="preside != null and preside != ''">
preside,
</if>
<if test="data_start != null and data_start != ''">
data_start,
</if>
<if test="data_implement != null and data_implement != ''">
data_implement,
</if>
<if test="body != null and body != ''">
body,
</if>
<if test="drafting != null and drafting != ''">
drafting,
</if>
<if test="data_record != null and data_record != ''">
data_record,
</if>
<if test="report != null and report != ''">
report,
</if>
<if test="participants != null and participants != ''">
participants,
</if>
<if test="celebrity != null and celebrity != ''">
celebrity,
</if>
<if test="cost_marking != null and cost_marking != ''">
cost_marking,
</if>
<if test="cost_other != null and cost_other != ''">
cost_other,
</if>
<if test="revised != null and revised != ''">
revised,
</if>
<if test="status != null and status != ''">
status,
</if>
<if test="signature != null and signature != ''">
signature,
</if>
<if test="remark != null and remark != ''">
remark,
</if>
</trim>
values
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null and id != ''">
#{id},
</if>
<if test="stage != null and stage != ''">
#{stage},
</if>
<if test="number != null and number != ''">
#{number},
</if>
<if test="name != null and name != ''">
#{name},
</if>
<if test="project_id != null and project_id != ''">
#{projectId},
</if>
<if test="project_name != null and project_name != ''">
#{project_name},
</if>
<if test="type != null and type != ''">
#{type},
</if>
<if test="preside != null and preside != ''">
#{preside},
</if>
<if test="data_start != null and data_start != ''">
#{data_start},
</if>
<if test="data_implement != null and data_implement != ''">
#{data_implement},
</if>
<if test="body != null and body != ''">
#{body},
</if>
<if test="drafting != null and drafting != ''">
#{drafting},
</if>
<if test="data_record != null and data_record != ''">
#{data_record},
</if>
<if test="report != null and report != ''">
#{report},
</if>
<if test="participants != null and participants != ''">
#{participants},
</if>
<if test="celebrity != null and celebrity != ''">
#{celebrity},
</if>
<if test="cost_marking != null and cost_marking != ''">
#{cost_marking},
</if>
<if test="cost_other != null and cost_other != ''">
#{cost_other},
</if>
<if test="revised != null and revised != ''">
#{revised},
</if>
<if test="status != null and status != ''">
#{status},
</if>
<if test="signature != null and signature != ''">
#{signature},
</if>
<if test="remark != null and remark != ''">
#{remark},
</if>
</trim>
</insert>
<!-- 删除-->
<delete id="deleteOne" parameterType="java.lang.String">
delete from wgd_wbxd where id = #{id}
</delete>
<!-- 批量删除-->
<delete id="deleteBatch" parameterType="java.lang.String">
delete from wgd_wbxd where id in
<foreach collection="array" item="id" open="(" close=")" separator=",">
#{id}
</foreach>
</delete>
</mapper>