123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238 |
- <?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.StaExpertFeeDao">
- <resultMap type="com.liang.entity.StaExpertFee" id="StaExpertFeeMap">
- <result property="id" column="ID" jdbcType="INTEGER"/>
- <result property="zb" column="ZB" jdbcType="INTEGER"/>
- <result property="zjxm" column="ZJXM" jdbcType="VARCHAR"/>
- <result property="sfzh" column="SFZH" jdbcType="VARCHAR"/>
- <result property="fysq" column="FYSQ" jdbcType="NUMERIC"/>
- <result property="bzfy" column="BZFY" jdbcType="NUMERIC"/>
- <result property="zc" column="ZC" jdbcType="VARCHAR"/>
- <result property="kyfh" column="KYFH" jdbcType="VARCHAR"/>
- </resultMap>
- <!--查询单个-->
- <select id="queryById" resultMap="StaExpertFeeMap">
- select ID,
- ZB,
- ZJXM,
- SFZH,
- FYSQ,
- BZFY,
- ZC,
- KYFH
- from sta_ExpertFee
- where ID = #{id}
- </select>
- <!--查询指定行数据-->
- <select id="queryAllByLimit" resultMap="StaExpertFeeMap">
- select
- ID, ZB, ZJXM, SFZH, FYSQ, BZFY, ZC, KYFH
- from sta_ExpertFee
- <where>
- <if test="id != null">
- and ID = #{id}
- </if>
- <if test="zb != null">
- and ZB = #{zb}
- </if>
- <if test="zjxm != null and zjxm != ''">
- and ZJXM = #{zjxm}
- </if>
- <if test="sfzh != null and sfzh != ''">
- and SFZH = #{sfzh}
- </if>
- <if test="fysq != null">
- and FYSQ = #{fysq}
- </if>
- <if test="bzfy != null">
- and BZFY = #{bzfy}
- </if>
- <if test="zc != null and zc != ''">
- and ZC = #{zc}
- </if>
- <if test="kyfh != null and kyfh != ''">
- and KYFH = #{kyfh}
- </if>
- </where>
- limit #{pageable.offset}, #{pageable.pageSize}
- </select>
- <!--统计总行数-->
- <select id="count" resultType="java.lang.Long">
- select count(1)
- from sta_ExpertFee
- <where>
- <if test="id != null">
- and ID = #{id}
- </if>
- <if test="zb != null">
- and ZB = #{zb}
- </if>
- <if test="zjxm != null and zjxm != ''">
- and ZJXM = #{zjxm}
- </if>
- <if test="sfzh != null and sfzh != ''">
- and SFZH = #{sfzh}
- </if>
- <if test="fysq != null">
- and FYSQ = #{fysq}
- </if>
- <if test="bzfy != null">
- and BZFY = #{bzfy}
- </if>
- <if test="zc != null and zc != ''">
- and ZC = #{zc}
- </if>
- <if test="kyfh != null and kyfh != ''">
- and KYFH = #{kyfh}
- </if>
- </where>
- </select>
- <!--新增所有列-->
- <insert id="insert" keyProperty="id" useGeneratedKeys="true">
- insert into sta_ExpertFee(ZB, ZJXM, SFZH, FYSQ, BZFY, ZC, KYFH)
- values (#{zb}, #{zjxm}, #{sfzh}, #{fysq}, #{bzfy}, #{zc}, #{kyfh})
- </insert>
- <!--批量插入专家咨询费-->
- <insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
- insert into sta_ExpertFee(ZB, ZJXM, SFZH, FYSQ, BZFY, ZC, KYFH)
- values
- <foreach collection="entities" item="entity" separator=",">
- (#{entity.zb}, #{entity.zjxm}, #{entity.sfzh}, #{entity.fysq}, #{entity.bzfy}, #{entity.zc}, #{entity.kyfh})
- </foreach>
- </insert>
- <insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
- insert into sta_ExpertFee(ZB, ZJXM, SFZH, FYSQ, BZFY, ZC, KYFH)
- values
- <foreach collection="entities" item="entity" separator=",">
- (#{entity.zb}, #{entity.zjxm}, #{entity.sfzh}, #{entity.fysq}, #{entity.bzfy}, #{entity.zc}, #{entity.kyfh})
- </foreach>
- on duplicate key update
- ZB = values(ZB),
- ZJXM = values(ZJXM),
- SFZH = values(SFZH),
- FYSQ = values(FYSQ),
- BZFY = values(BZFY),
- ZC = values(ZC),
- KYFH = values(KYFH)
- </insert>
- <!--通过主键修改数据-->
- <update id="update">
- update sta_ExpertFee
- <set>
- <if test="zb != null">
- ZB = #{zb},
- </if>
- <if test="zjxm != null and zjxm != ''">
- ZJXM = #{zjxm},
- </if>
- <if test="sfzh != null and sfzh != ''">
- SFZH = #{sfzh},
- </if>
- <if test="fysq != null">
- FYSQ = #{fysq},
- </if>
- <if test="bzfy != null">
- BZFY = #{bzfy},
- </if>
- <if test="zc != null and zc != ''">
- ZC = #{zc},
- </if>
- <if test="kyfh != null and kyfh != ''">
- KYFH = #{kyfh},
- </if>
- </set>
- where ID = #{id}
- </update>
- <!--通过主键删除-->
- <delete id="deleteById">
- delete
- from sta_ExpertFee
- where ID = #{id}
- </delete>
- <!--通过主表删除-->
- <delete id="deleteByZb">
- delete
- from sta_ExpertFee
- where ZB = #{zb}
- </delete>
- <!--批量删除专家咨询费-->
- <delete id="batchDeleteByZb" parameterType="java.util.ArrayList">
- delete from sta_ExpertFee
- where ZB in
- <foreach item="item" index="index" collection="zbList" open="(" separator="," close=")">
- #{item}
- </foreach>
- </delete>
- <!--获取专家咨询费列表-->
- <select id="getZjfList" resultMap="StaExpertFeeMap">
- select e.*
- from sta_ExpertFee e
- where ZB = #{zb}
- </select>
- <select id="queryByKyfh" resultMap="StaExpertFeeMap">
- select *
- from sta_ExpertFee
- where KYFH like #{kyfh} + '%'
- order by ID desc
- </select>
- <select id="searchExpertFeeCost" resultType="Map">
- SELECT sta_ExpertFee.ID,
- sys_dept_info.dept_name AS BM,
- sta_BudgetApproval.XMMC,
- base_ProjectType.XMLXMC,
- base_Person.XM AS XMFZR,
- sta_ExpertFee.ZJXM,
- sta_ExpertFee.SFZH,
- sta_ExpertFee.FYSQ,
- sta_ExpertFee.BZFY,
- sta_ExpertFee.ZC,
- sta_ExpertFee.KYFH,
- CASE
- WHEN sta_BudgetApproval.SFBYJ = 0 THEN '否'
- WHEN sta_BudgetApproval.SFBYJ = 1 THEN '是'
- ELSE CAST(sta_BudgetApproval.SFBYJ AS varchar(11))
- END AS SFBYJ,
- CAST(sta_BudgetApproval.SQSJ AS date) AS SQSJ
- FROM sta_ExpertFee,
- sta_BudgetApproval,
- prj_Project,
- sys_dept_info,
- base_Person,
- base_ProjectType
- WHERE sta_ExpertFee.ZB = sta_BudgetApproval.ID
- AND sta_BudgetApproval.XMID = prj_Project.ID
- AND sta_BudgetApproval.SSBM = sys_dept_info.dept_id
- AND sta_BudgetApproval.XMFZR = base_Person.ID
- AND sta_BudgetApproval.XMLX = base_ProjectType.XMLX
- <if test="MC != null and MC != ''">
- AND sta_BudgetApproval.XMMC LIKE '%${MC}%'
- </if>
- <if test="ZJXM != null and ZJXM != ''">
- AND sta_ExpertFee.ZJXM LIKE '%${ZJXM}%'
- </if>
- <if test="ZC != null and ZC != ''">
- AND sta_ExpertFee.ZC LIKE '%${ZC}%'
- </if>
- <if test="QSRQ != null and QSRQ != ''">
- AND sta_BudgetApproval.SQSJ <![CDATA[>= ]]> #{QSRQ}
- </if>
- <if test="JZRQ != null and JZRQ != ''">
- AND sta_BudgetApproval.SQSJ <![CDATA[<= ]]> #{JZRQ}
- </if>
- </select>
- </mapper>
|