123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225 |
- <?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.ViewApproveRecordDao">
- <resultMap type="com.liang.entity.ViewApproveRecord" id="ViewApproveRecordMap">
- <result property="tablename" column="TABLENAME" jdbcType="VARCHAR"/>
- <result property="xmid" column="XMID" jdbcType="INTEGER"/>
- <result property="xm" column="XM" jdbcType="VARCHAR"/>
- <result property="zt" column="ZT" jdbcType="VARCHAR"/>
- <result property="wc" column="WC" jdbcType="VARCHAR"/>
- <result property="tjsj" column="TJSJ" jdbcType="TIMESTAMP"/>
- <result property="shsj" column="SHSJ" jdbcType="TIMESTAMP"/>
- <result property="tjr" column="TJR" jdbcType="INTEGER"/>
- <result property="shr" column="SHR" jdbcType="INTEGER"/>
- <result property="tjrname" column="TJRNAME" jdbcType="VARCHAR"/>
- <result property="t" column="T" jdbcType="VARCHAR"/>
- <result property="shrname" column="SHRNAME" jdbcType="VARCHAR"/>
- <result property="shrdw" column="SHRDW" jdbcType="VARCHAR"/>
- </resultMap>
- <!--查询单个-->
- <select id="queryById" resultMap="ViewApproveRecordMap">
- select
- TABLENAME, XMID, XM, ZT, WC, TJSJ, SHSJ, TJR, SHR, TJRNAME, T, SHRNAME, SHRDW
- from view_approve_record
- where = #{id}
- </select>
- <!--查询指定行数据-->
- <select id="queryAllByLimit" resultMap="ViewApproveRecordMap">
- select
- TABLENAME, XMID, XM, ZT, WC, TJSJ, SHSJ, TJR, SHR, TJRNAME, T, SHRNAME, SHRDW
- from view_approve_record
- <where>
- <if test="tablename != null and tablename != ''">
- and TABLENAME = #{tablename}
- </if>
- <if test="xmid != null">
- and XMID = #{xmid}
- </if>
- <if test="xm != null and xm != ''">
- and XM = #{xm}
- </if>
- <if test="zt != null and zt != ''">
- and ZT = #{zt}
- </if>
- <if test="wc != null and wc != ''">
- and WC = #{wc}
- </if>
- <if test="tjsj != null">
- and TJSJ = #{tjsj}
- </if>
- <if test="shsj != null">
- and SHSJ = #{shsj}
- </if>
- <if test="tjr != null">
- and TJR = #{tjr}
- </if>
- <if test="shr != null">
- and SHR = #{shr}
- </if>
- <if test="tjrname != null and tjrname != ''">
- and TJRNAME = #{tjrname}
- </if>
- <if test="t != null and t != ''">
- and T = #{t}
- </if>
- <if test="shrname != null and shrname != ''">
- and SHRNAME = #{shrname}
- </if>
- <if test="shrdw != null and shrdw != ''">
- and SHRDW = #{shrdw}
- </if>
- </where>
- limit #{pageable.offset}, #{pageable.pageSize}
- </select>
- <!--统计总行数-->
- <select id="count" resultType="java.lang.Long">
- select count(1)
- from view_approve_record
- <where>
- <if test="tablename != null and tablename != ''">
- and TABLENAME = #{tablename}
- </if>
- <if test="xmid != null">
- and XMID = #{xmid}
- </if>
- <if test="xm != null and xm != ''">
- and XM = #{xm}
- </if>
- <if test="zt != null and zt != ''">
- and ZT = #{zt}
- </if>
- <if test="wc != null and wc != ''">
- and WC = #{wc}
- </if>
- <if test="tjsj != null">
- and TJSJ = #{tjsj}
- </if>
- <if test="shsj != null">
- and SHSJ = #{shsj}
- </if>
- <if test="tjr != null">
- and TJR = #{tjr}
- </if>
- <if test="shr != null">
- and SHR = #{shr}
- </if>
- <if test="tjrname != null and tjrname != ''">
- and TJRNAME = #{tjrname}
- </if>
- <if test="t != null and t != ''">
- and T = #{t}
- </if>
- <if test="shrname != null and shrname != ''">
- and SHRNAME = #{shrname}
- </if>
- <if test="shrdw != null and shrdw != ''">
- and SHRDW = #{shrdw}
- </if>
- </where>
- </select>
- <!--新增所有列-->
- <insert id="insert" keyProperty="" useGeneratedKeys="true">
- insert into view_approve_record(TABLENAME, XMID, XM, ZT, WC, TJSJ, SHSJ, TJR, SHR, TJRNAME, T, SHRNAME, SHRDW)
- values (#{tablename}, #{xmid}, #{xm}, #{zt}, #{wc}, #{tjsj}, #{shsj}, #{tjr}, #{shr}, #{tjrname}, #{t}, #{shrname}, #{shrdw})
- </insert>
- <insert id="insertBatch" keyProperty="" useGeneratedKeys="true">
- insert into view_approve_record(TABLENAME, XMID, XM, ZT, WC, TJSJ, SHSJ, TJR, SHR, TJRNAME, T, SHRNAME, SHRDW)
- values
- <foreach collection="entities" item="entity" separator=",">
- (#{entity.tablename}, #{entity.xmid}, #{entity.xm}, #{entity.zt}, #{entity.wc}, #{entity.tjsj}, #{entity.shsj}, #{entity.tjr}, #{entity.shr}, #{entity.tjrname}, #{entity.t}, #{entity.shrname}, #{entity.shrdw})
- </foreach>
- </insert>
- <insert id="insertOrUpdateBatch" keyProperty="" useGeneratedKeys="true">
- insert into view_approve_record(TABLENAME, XMID, XM, ZT, WC, TJSJ, SHSJ, TJR, SHR, TJRNAME, T, SHRNAME, SHRDW)
- values
- <foreach collection="entities" item="entity" separator=",">
- (#{entity.tablename}, #{entity.xmid}, #{entity.xm}, #{entity.zt}, #{entity.wc}, #{entity.tjsj}, #{entity.shsj}, #{entity.tjr}, #{entity.shr}, #{entity.tjrname}, #{entity.t}, #{entity.shrname}, #{entity.shrdw})
- </foreach>
- on duplicate key update
- TABLENAME = values(TABLENAME),
- XMID = values(XMID),
- XM = values(XM),
- ZT = values(ZT),
- WC = values(WC),
- TJSJ = values(TJSJ),
- SHSJ = values(SHSJ),
- TJR = values(TJR),
- SHR = values(SHR),
- TJRNAME = values(TJRNAME),
- T = values(T),
- SHRNAME = values(SHRNAME),
- SHRDW = values(SHRDW)
- </insert>
- <!--通过主键修改数据-->
- <update id="update">
- update view_approve_record
- <set>
- <if test="tablename != null and tablename != ''">
- TABLENAME = #{tablename},
- </if>
- <if test="xmid != null">
- XMID = #{xmid},
- </if>
- <if test="xm != null and xm != ''">
- XM = #{xm},
- </if>
- <if test="zt != null and zt != ''">
- ZT = #{zt},
- </if>
- <if test="wc != null and wc != ''">
- WC = #{wc},
- </if>
- <if test="tjsj != null">
- TJSJ = #{tjsj},
- </if>
- <if test="shsj != null">
- SHSJ = #{shsj},
- </if>
- <if test="tjr != null">
- TJR = #{tjr},
- </if>
- <if test="shr != null">
- SHR = #{shr},
- </if>
- <if test="tjrname != null and tjrname != ''">
- TJRNAME = #{tjrname},
- </if>
- <if test="t != null and t != ''">
- T = #{t},
- </if>
- <if test="shrname != null and shrname != ''">
- SHRNAME = #{shrname},
- </if>
- <if test="shrdw != null and shrdw != ''">
- SHRDW = #{shrdw},
- </if>
- </set>
- where = #{}
- </update>
- <!--通过主键删除-->
- <delete id="deleteById">
- delete from view_approve_record where = #{id}
- </delete>
- <!--查询单个-->
- <select id="getApproveRecordList" resultMap="ViewApproveRecordMap">
- SELECT prj_ApproveRecord.ID, prj_ApproveRecord.TABLENAME, prj_ApproveRecord.XMID, prj_ApproveRecord.XM, prj_ApproveRecord.ZT, prj_ApproveRecord.WC, prj_ApproveRecord.TJSJ, prj_ApproveRecord.SHSJ,
- prj_ApproveRecord.TJR, prj_ApproveRecord.SHR, base_Person.XM AS TJRNAME, base_Company.MC AS TJRDW, sys_user_info.name as SHRNAME, sys_dept_info.dept_name as SHRDW
- FROM sys_dept_info RIGHT OUTER JOIN
- sys_user_info ON sys_dept_info.dept_id = sys_user_info.dept_id RIGHT OUTER JOIN
- prj_ApproveRecord LEFT OUTER JOIN
- base_Person base_Person LEFT OUTER JOIN
- base_Company base_Company ON base_Person.DW = base_Company.ID ON prj_ApproveRecord.TJR = base_Person.ID ON sys_user_info.user_id = prj_ApproveRecord.SHR
- where WC = 0 order by xmid asc,tjsj asc
- </select>
- </mapper>
|