| | |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.lf.server.mapper.show.ApplyMapper"> |
| | | <select id="selectCount" resultType="java.lang.Integer"> |
| | | select count(*) from lf.sys_apply |
| | | select count(*) from lf.sys_apply a inner join lf.sys_user b on a.userid = b.id |
| | | <where> |
| | | <if test="userid != null"> |
| | | userid = #{userid} |
| | | 1 = 1 |
| | | <if test="uname != null"> |
| | | and b.uname like #{uname} |
| | | </if> |
| | | <if test="status != null"> |
| | | <if test="status == 0"> |
| | | and a.status between 0 and 9 |
| | | </if> |
| | | <if test="status != 0"> |
| | | and a.status = #{status} |
| | | </if> |
| | | </if> |
| | | <if test="start != null"> |
| | | and a.create_time >= #{start} |
| | | </if> |
| | | <if test="end != null"> |
| | | and a.create_time <= #{end} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="selectByPage" resultType="com.lf.server.entity.show.ApplyEntity"> |
| | | select * from lf.sys_apply |
| | | select a.*, b.uname, (select count(*) from lf.sys_flow c where c.applyid = a.id and c.status = 0 and c.userid = #{userid}) isVerify |
| | | from lf.sys_apply a inner join lf.sys_user b on a.userid = b.id |
| | | <where> |
| | | <if test="userid != null"> |
| | | userid = #{userid} |
| | | 1 = 1 |
| | | <if test="uname != null"> |
| | | and b.uname like #{uname} |
| | | </if> |
| | | <if test="status != null"> |
| | | <if test="status == 0"> |
| | | and a.status between 0 and 9 |
| | | </if> |
| | | <if test="status != 0"> |
| | | and a.status = #{status} |
| | | </if> |
| | | </if> |
| | | <if test="start != null"> |
| | | and a.create_time >= #{start} |
| | | </if> |
| | | <if test="end != null"> |
| | | and a.create_time <= #{end} |
| | | </if> |
| | | </where> |
| | | order by id |
| | | order by a.id desc |
| | | limit #{limit} offset #{offset} |
| | | </select> |
| | | |
| | | <select id="selectAll" resultType="com.lf.server.entity.show.ApplyEntity"> |
| | | select * from lf.sys_apply order by id; |
| | | select * from lf.sys_apply order by id desc |
| | | </select> |
| | | |
| | | <select id="selectById" resultType="com.lf.server.entity.show.ApplyEntity"> |
| | |
| | | inner join lf.sys_user c on b.userid = c.id |
| | | where a.is_admin = 2 and a.depid = #{depid} |
| | | order by c.id limit 1 |
| | | </select> |
| | | |
| | | <select id="selectSubmits" resultType="java.lang.Integer"> |
| | | select count(*) from lf.sys_apply a inner join lf.sys_flow b on a.id = b.applyid |
| | | where a.status between 0 and 9 and b.status = 0 and b.userid = #{userid} |
| | | </select> |
| | | |
| | | <select id="selectFlows" resultType="com.lf.server.entity.show.FlowEntity"> |
| | | select a.*, b.uname, fn_get_fullname(b.depcode, 1) depName |
| | | from lf.sys_flow a inner join lf.sys_user b on a.userid = b.id |
| | | where a.applyid = #{applyid} |
| | | </select> |
| | | |
| | | <insert id="insert" parameterType="com.lf.server.entity.show.ApplyEntity"> |
| | |
| | | where id = #{item.id} |
| | | </foreach> |
| | | </update> |
| | | |
| | | <update id="updateForDiscard"> |
| | | update lf.sys_apply set status = -10, update_user = #{userid}, update_time = now() where status between -1 and 9 and id = #{id} |
| | | </update> |
| | | |
| | | <update id="updateForResubmit"> |
| | | update lf.sys_flow set status = 0, update_user = #{userid}, update_time = now() where status = -1 and applyid = #{id}; |
| | | update lf.sys_apply a set status = (select count(*) from lf.sys_flow b where b.status = 1 and b.applyid = a.id), update_user = #{userid}, update_time = now() where status = -1 and id = #{id}; |
| | | </update> |
| | | |
| | | <update id="updateForSubmit"> |
| | | update lf.sys_flow set status = 1, update_user = #{userid}, update_time = now() where id = #{flowId}; |
| | | update lf.sys_apply a set status = (select count(*) from lf.sys_flow b where b.status = 1 and b.applyid = a.id), update_user = #{userid}, update_time = now() where id = #{applyid}; |
| | | update lf.sys_apply set status = 10 where status = count and id = #{applyid}; |
| | | </update> |
| | | |
| | | <update id="updateForReject"> |
| | | update lf.sys_flow set status = -1, update_user = #{userid}, update_time = now() where status = 0 and id = #{flowId}; |
| | | update lf.sys_apply set status = -1, update_user = #{userid}, update_time = now() where status between 0 and 9 and id = #{applyid}; |
| | | </update> |
| | | </mapper> |