123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231 |
- <?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.liang.dao.StaSoftwareexpensesDao">
- <resultMap type="com.liang.entity.StaSoftwareexpenses" id="StaSoftwareexpensesMap">
- <result property="id" column="ID" jdbcType="INTEGER"/>
- <result property="zb" column="ZB" jdbcType="INTEGER"/>
- <result property="xh" column="XH" jdbcType="INTEGER"/>
- <result property="rjmc" column="RJMC" jdbcType="VARCHAR"/>
- <result property="rjxh" column="RJXH" jdbcType="VARCHAR"/>
- <result property="dj" column="DJ" jdbcType="NUMERIC"/>
- <result property="sl" column="SL" jdbcType="INTEGER"/>
- <result property="zj" column="ZJ" jdbcType="NUMERIC"/>
- <result property="scgbydq" column="SCGBYDQ" jdbcType="VARCHAR"/>
- <result property="lsdw" column="LSDW" jdbcType="VARCHAR"/>
- <result property="rjzyjsxnzb" column="RJZYJSXNZB" jdbcType="VARCHAR"/>
- <result property="gzsj" column="GZSJ" jdbcType="TIMESTAMP"/>
- <result property="syfjqdj" column="SYFJQDJ" jdbcType="NUMERIC"/>
- </resultMap>
- <!--查询单个-->
- <select id="queryById" resultMap="StaSoftwareexpensesMap">
- select
- ID, ZB, XH, RJMC, RJXH, DJ, SL, ZJ, SCGBYDQ, LSDW, RJZYJSXNZB, GZSJ, SYFJQDJ
- from sta_SoftwareExpenses
- where ID = #{id}
- </select>
- <!--查询指定行数据-->
- <select id="queryAllByLimit" resultMap="StaSoftwareexpensesMap">
- select
- ID, ZB, XH, RJMC, RJXH, DJ, SL, ZJ, SCGBYDQ, LSDW, RJZYJSXNZB, GZSJ, SYFJQDJ
- from sta_SoftwareExpenses
- <where>
- <if test="id != null">
- and ID = #{id}
- </if>
- <if test="zb != null">
- and ZB = #{zb}
- </if>
- <if test="xh != null">
- and XH = #{xh}
- </if>
- <if test="rjmc != null and rjmc != ''">
- and RJMC = #{rjmc}
- </if>
- <if test="rjxh != null and rjxh != ''">
- and RJXH = #{rjxh}
- </if>
- <if test="dj != null">
- and DJ = #{dj}
- </if>
- <if test="sl != null">
- and SL = #{sl}
- </if>
- <if test="zj != null">
- and ZJ = #{zj}
- </if>
- <if test="scgbydq != null and scgbydq != ''">
- and SCGBYDQ = #{scgbydq}
- </if>
- <if test="lsdw != null and lsdw != ''">
- and LSDW = #{lsdw}
- </if>
- <if test="rjzyjsxnzb != null and rjzyjsxnzb != ''">
- and RJZYJSXNZB = #{rjzyjsxnzb}
- </if>
- <if test="gzsj != null">
- and GZSJ = #{gzsj}
- </if>
- <if test="syfjqdj != null">
- and SYFJQDJ = #{syfjqdj}
- </if>
- </where>
- limit #{pageable.offset}, #{pageable.pageSize}
- </select>
- <!--统计总行数-->
- <select id="count" resultType="java.lang.Long">
- select count(1)
- from sta_SoftwareExpenses
- <where>
- <if test="id != null">
- and ID = #{id}
- </if>
- <if test="zb != null">
- and ZB = #{zb}
- </if>
- <if test="xh != null">
- and XH = #{xh}
- </if>
- <if test="rjmc != null and rjmc != ''">
- and RJMC = #{rjmc}
- </if>
- <if test="rjxh != null and rjxh != ''">
- and RJXH = #{rjxh}
- </if>
- <if test="dj != null">
- and DJ = #{dj}
- </if>
- <if test="sl != null">
- and SL = #{sl}
- </if>
- <if test="zj != null">
- and ZJ = #{zj}
- </if>
- <if test="scgbydq != null and scgbydq != ''">
- and SCGBYDQ = #{scgbydq}
- </if>
- <if test="lsdw != null and lsdw != ''">
- and LSDW = #{lsdw}
- </if>
- <if test="rjzyjsxnzb != null and rjzyjsxnzb != ''">
- and RJZYJSXNZB = #{rjzyjsxnzb}
- </if>
- <if test="gzsj != null">
- and GZSJ = #{gzsj}
- </if>
- <if test="syfjqdj != null">
- and SYFJQDJ = #{syfjqdj}
- </if>
- </where>
- </select>
- <!--新增所有列-->
- <insert id="insert" keyProperty="id" useGeneratedKeys="true">
- insert into sta_SoftwareExpenses(ZB, XH, RJMC, RJXH, DJ, SL, ZJ, SCGBYDQ, LSDW, RJZYJSXNZB, GZSJ, SYFJQDJ)
- values (#{zb}, #{xh}, #{rjmc}, #{rjxh}, #{dj}, #{sl}, #{zj}, #{scgbydq}, #{lsdw}, #{rjzyjsxnzb}, #{gzsj}, #{syfjqdj})
- </insert>
- <insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
- insert into sta_SoftwareExpenses(ZB, XH, RJMC, RJXH, DJ, SL, ZJ, SCGBYDQ, LSDW, RJZYJSXNZB, GZSJ, SYFJQDJ)
- values
- <foreach collection="entities" item="entity" separator=",">
- (#{entity.zb}, #{entity.xh}, #{entity.rjmc}, #{entity.rjxh}, #{entity.dj}, #{entity.sl}, #{entity.zj}, #{entity.scgbydq}, #{entity.lsdw}, #{entity.rjzyjsxnzb}, #{entity.gzsj}, #{entity.syfjqdj})
- </foreach>
- </insert>
- <insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
- insert into sta_SoftwareExpenses(ZB, XH, RJMC, RJXH, DJ, SL, ZJ, SCGBYDQ, LSDW, RJZYJSXNZB, GZSJ, SYFJQDJ)
- values
- <foreach collection="entities" item="entity" separator=",">
- (#{entity.zb}, #{entity.xh}, #{entity.rjmc}, #{entity.rjxh}, #{entity.dj}, #{entity.sl}, #{entity.zj}, #{entity.scgbydq}, #{entity.lsdw}, #{entity.rjzyjsxnzb}, #{entity.gzsj}, #{entity.syfjqdj})
- </foreach>
- on duplicate key update
- ZB = values(ZB),
- XH = values(XH),
- RJMC = values(RJMC),
- RJXH = values(RJXH),
- DJ = values(DJ),
- SL = values(SL),
- ZJ = values(ZJ),
- SCGBYDQ = values(SCGBYDQ),
- LSDW = values(LSDW),
- RJZYJSXNZB = values(RJZYJSXNZB),
- GZSJ = values(GZSJ),
- SYFJQDJ = values(SYFJQDJ)
- </insert>
- <!--通过主键修改数据-->
- <update id="update">
- update sta_SoftwareExpenses
- <set>
- <if test="zb != null">
- ZB = #{zb},
- </if>
- <if test="xh != null">
- XH = #{xh},
- </if>
- <if test="rjmc != null and rjmc != ''">
- RJMC = #{rjmc},
- </if>
- <if test="rjxh != null and rjxh != ''">
- RJXH = #{rjxh},
- </if>
- <if test="dj != null">
- DJ = #{dj},
- </if>
- <if test="sl != null">
- SL = #{sl},
- </if>
- <if test="zj != null">
- ZJ = #{zj},
- </if>
- <if test="scgbydq != null and scgbydq != ''">
- SCGBYDQ = #{scgbydq},
- </if>
- <if test="lsdw != null and lsdw != ''">
- LSDW = #{lsdw},
- </if>
- <if test="rjzyjsxnzb != null and rjzyjsxnzb != ''">
- RJZYJSXNZB = #{rjzyjsxnzb},
- </if>
- <if test="gzsj != null">
- GZSJ = #{gzsj},
- </if>
- <if test="syfjqdj != null">
- SYFJQDJ = #{syfjqdj},
- </if>
- </set>
- where ID = #{id}
- </update>
- <!--通过主键删除-->
- <delete id="deleteById">
- delete from sta_SoftwareExpenses where ID = #{id}
- </delete>
- <!--获取软件使用费列表-->
- <select id="getRjsyfList" resultMap="StaSoftwareexpensesMap">
- select *
- from sta_SoftwareExpenses
- where ZB = #{zb}
- </select>
- <!--通过主表删除-->
- <delete id="deleteByZb">
- delete from sta_SoftwareExpenses where ZB = #{zb}
- </delete>
- <!--批量删除-->
- <delete id="batchDeleteByZb" parameterType="java.util.ArrayList">
- delete from sta_SoftwareExpenses
- where ZB in
- <foreach item="item" index="index" collection="zbList" open = "(" separator = "," close = ")">
- #{item}
- </foreach>
- </delete>
- </mapper>
|