164 lines
6.2 KiB
XML
164 lines
6.2 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.wgdCensusZ.dao.WgdAssocCostDao">
|
|
|
|
<sql id="pages">
|
|
<if test=" null != pageSize ">
|
|
LIMIT ${(page-1) * pageSize},${pageSize}
|
|
</if>
|
|
</sql>
|
|
<!-- 基础信息-->
|
|
<sql id="BaseInfo">
|
|
id,sc_name,ssc_name,wg_name,pay_standard,pay_reality,cost_outlay,annual_payment
|
|
</sql>
|
|
<!-- 查询条件-->
|
|
<sql id="Conditions">
|
|
<where>
|
|
<if test="id != null and id != ''">
|
|
and id = #{id}
|
|
</if>
|
|
<if test="scName != null and scName != ''">
|
|
and sc_name like concat('%',#{scName},'%')
|
|
</if>
|
|
<if test="sscName != null and sscName != ''">
|
|
and ssc_name like concat('%',#{sscName},'%')
|
|
</if>
|
|
<if test="wgName != null and wgName != ''">
|
|
and wg_name like concat('%',#{wgName},'%')
|
|
</if>
|
|
<if test="payStandard != null and payStandard != ''">
|
|
and pay_standard = #{payStandard}
|
|
</if>
|
|
<if test="payReality != null and payReality != ''">
|
|
and pay_reality = #{payReality}
|
|
</if>
|
|
<if test="costOutlay != null and costOutlay != ''">
|
|
and cost_outlay = #{costOutlay}
|
|
</if>
|
|
<if test="annualPayment != null and annualPayment != ''">
|
|
and annual_payment = #{annualPayment}
|
|
</if>
|
|
</where>
|
|
</sql>
|
|
|
|
<select id="getTotal" resultType="java.lang.Integer">
|
|
select count(*) from wgd_assoc_cost
|
|
</select>
|
|
<select id="getQueryTotal" parameterType="com.adc.da.slrs.wgdCensusZ.entity.WgdAssocCost" resultType="java.lang.Integer">
|
|
select count(*) from wgd_assoc_cost
|
|
<include refid="Conditions"></include>
|
|
</select>
|
|
<!-- 查询所有-->
|
|
<select id="selectAll" resultType="com.adc.da.slrs.wgdCensusZ.entity.WgdAssocCost">
|
|
select <include refid="BaseInfo"></include> from wgd_assoc_cost
|
|
<include refid="pages"></include>
|
|
</select>
|
|
<!-- 多条件查询-->
|
|
<select id="queryAll" parameterType="com.adc.da.slrs.wgdCensusZ.entity.WgdAssocCost" resultType="com.adc.da.slrs.wgdCensusZ.entity.WgdAssocCost">
|
|
select <include refid="BaseInfo"></include> from wgd_assoc_cost
|
|
<include refid="Conditions"></include>
|
|
<include refid="pages"></include>
|
|
</select>
|
|
<!-- 查询详情-->
|
|
<select id="selectOne" parameterType="java.lang.String" resultType="com.adc.da.slrs.wgdCensusZ.entity.WgdAssocCost">
|
|
select <include refid="BaseInfo"></include> from wgd_assoc_cost
|
|
where id = #{id}
|
|
</select>
|
|
<!-- 修改-->
|
|
<update id="updateOne" parameterType="com.adc.da.slrs.wgdCensusZ.entity.WgdAssocCost">
|
|
update wgd_assoc_cost
|
|
<set>
|
|
<if test="scName != null and scName != ''">
|
|
sc_name = #{scName},
|
|
</if>
|
|
<if test="sscName != null and sscName != ''">
|
|
ssc_name = #{sscName},
|
|
</if>
|
|
<if test="wgName != null and wgName != ''">
|
|
wg_name = #{wgName},
|
|
</if>
|
|
<if test="payStandard != null and payStandard != ''">
|
|
pay_standard = #{payStandard},
|
|
</if>
|
|
<if test="payReality != null and payReality != ''">
|
|
pay_reality = #{payReality},
|
|
</if>
|
|
<if test="costOutlay != null and costOutlay != ''">
|
|
cost_outlay = #{costOutlay},
|
|
</if>
|
|
<if test="annualPayment != null and annualPayment != ''">
|
|
annual_payment = #{annualPayment},
|
|
</if>
|
|
</set>
|
|
where id = #{id}
|
|
</update>
|
|
<!-- 插入一条数据-->
|
|
<insert id="insertOne" parameterType="com.adc.da.slrs.wgdCensusZ.entity.WgdAssocCost">
|
|
insert into wgd_assoc_cost
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="id != null and id != ''">
|
|
id,
|
|
</if>
|
|
<if test="scName != null and scName != ''">
|
|
sc_name,
|
|
</if>
|
|
<if test="sscName != null and sscName != ''">
|
|
ssc_name,
|
|
</if>
|
|
<if test="wgName != null and wgName != ''">
|
|
wg_name,
|
|
</if>
|
|
<if test="payStandard != null and payStandard != ''">
|
|
pay_standard,
|
|
</if>
|
|
<if test="payReality != null and payReality != ''">
|
|
pay_reality,
|
|
</if>
|
|
<if test="costOutlay != null and costOutlay != ''">
|
|
cost_outlay,
|
|
</if>
|
|
<if test="annualPayment != null and annualPayment != ''">
|
|
annual_payment,
|
|
</if>
|
|
</trim>
|
|
values
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="id != null and id != ''">
|
|
#{id},
|
|
</if>
|
|
<if test="scName != null and scName != ''">
|
|
#{scName},
|
|
</if>
|
|
<if test="sscName != null and sscName != ''">
|
|
#{sscName},
|
|
</if>
|
|
<if test="wgName != null and wgName != ''">
|
|
#{wgName},
|
|
</if>
|
|
<if test="payStandard != null and payStandard != ''">
|
|
#{payStandard},
|
|
</if>
|
|
<if test="payReality != null and payReality != ''">
|
|
#{payReality},
|
|
</if>
|
|
<if test="costOutlay != null and costOutlay != ''">
|
|
#{costOutlay},
|
|
</if>
|
|
<if test="annualPayment != null and annualPayment != ''">
|
|
#{annualPayment},
|
|
</if>
|
|
</trim>
|
|
</insert>
|
|
<!-- 删除-->
|
|
<delete id="deleteOne" parameterType="java.lang.String">
|
|
delete from wgd_assoc_cost where id = #{id}
|
|
</delete>
|
|
<!-- 批量删除-->
|
|
<delete id="deleteBatch" parameterType="java.lang.String">
|
|
delete from wgd_assoc_cost where id in
|
|
<foreach collection="array" item="id" open="(" close=")" separator=",">
|
|
#{id}
|
|
</foreach>
|
|
</delete>
|
|
</mapper>
|