update
This commit is contained in:
@@ -2,11 +2,14 @@
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.rzdata.web.mapper.UseApplyMapper">
|
||||
<mapper namespace="com.rzdata.web.mapper.ToolApplyMapper">
|
||||
|
||||
<resultMap type="UseApply" id="UseApplyResult">
|
||||
<resultMap type="ToolApply" id="ToolApplyResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="userId" column="user_id" />
|
||||
<result property="toolId" column="tool_id" />
|
||||
<result property="procTitle" column="proc_title" />
|
||||
<result property="applyType" column="apply_type" />
|
||||
<result property="nickName" column="nick_name" />
|
||||
<result property="deptId" column="dept_id" />
|
||||
<result property="deptName" column="dept_name" />
|
||||
@@ -16,37 +19,51 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="procInstId" column="proc_inst_id" />
|
||||
<result property="endTime" column="end_time" />
|
||||
<result property="recordStatus" column="record_status" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectUseApplyVo">
|
||||
select id, user_id, nick_name, dept_id, dept_name, reason, create_by, create_time, update_by, update_time from t_use_apply
|
||||
<sql id="selectToolApplyVo">
|
||||
select id, user_id, nick_name, tool_id, apply_type, proc_title, proc_inst_id, end_time, dept_id, record_status, dept_name, reason, create_by, create_time, update_by, update_time from t_tool_apply
|
||||
</sql>
|
||||
|
||||
<select id="selectUseApplyList" parameterType="UseApply" resultMap="UseApplyResult">
|
||||
<include refid="selectUseApplyVo"/>
|
||||
<select id="selectToolApplyList" parameterType="ToolApply" resultMap="ToolApplyResult">
|
||||
<include refid="selectToolApplyVo"/>
|
||||
<where>
|
||||
<if test="userId != null and userId != ''"> and user_id like concat('%', #{userId}, '%')</if>
|
||||
<if test="deptId != null and deptId != ''"> and dept_id = #{deptId}</if>
|
||||
<if test="applyType != null and applyType != ''"> and apply_type = #{applyType}</if>
|
||||
<if test="reason != null and reason != ''"> and reason = #{reason}</if>
|
||||
<if test="recordStatus != null and recordStatus != ''"> and record_status = #{recordStatus}</if>
|
||||
<if test="procTitle != null and procTitle != ''"> and proc_title like concat('%', #{procTitle}, '%')</if>
|
||||
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
|
||||
AND date_format(create_time,'%y%m%d') >= date_format(#{params.beginTime},'%y%m%d')
|
||||
</if>
|
||||
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
|
||||
AND date_format(create_time,'%y%m%d') <= date_format(#{params.endTime},'%y%m%d')
|
||||
</if>
|
||||
</where>
|
||||
order by create_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectUseApplyById" parameterType="String" resultMap="UseApplyResult">
|
||||
<include refid="selectUseApplyVo"/>
|
||||
<select id="selectToolApplyById" parameterType="String" resultMap="ToolApplyResult">
|
||||
<include refid="selectToolApplyVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="getInfoByBpmcId" parameterType="String" resultMap="UseApplyResult">
|
||||
<include refid="selectUseApplyVo"/>
|
||||
<select id="getInfoByBpmcId" parameterType="String" resultMap="ToolApplyResult">
|
||||
<include refid="selectToolApplyVo"/>
|
||||
where proc_inst_id = #{bpmcId}
|
||||
</select>
|
||||
|
||||
<insert id="insertUseApply" parameterType="UseApply">
|
||||
insert into t_use_apply
|
||||
<insert id="insertToolApply" parameterType="ToolApply">
|
||||
insert into t_tool_apply
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</if>
|
||||
<if test="userId != null">user_id,</if>
|
||||
<if test="toolId != null">tool_id,</if>
|
||||
<if test="procTitle != null">proc_title,</if>
|
||||
<if test="applyType != null">apply_type,</if>
|
||||
<if test="nickName != null">nick_name,</if>
|
||||
<if test="deptId != null">dept_id,</if>
|
||||
<if test="deptName != null">dept_name,</if>
|
||||
@@ -56,11 +73,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="procInstId != null">proc_inst_id,</if>
|
||||
<if test="endTime != null">end_time,</if>
|
||||
<if test="recordStatus != null">record_status,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
<if test="userId != null">#{userId},</if>
|
||||
<if test="toolId != null">#{toolId},</if>
|
||||
<if test="procTitle != null">#{procTitle},</if>
|
||||
<if test="applyType != null">#{applyType},</if>
|
||||
<if test="nickName != null">#{nickName},</if>
|
||||
<if test="deptId != null">#{deptId},</if>
|
||||
<if test="deptName != null">#{deptName},</if>
|
||||
@@ -69,16 +90,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="endTime != null">#{endTime},</if>
|
||||
<if test="procInstId != null">#{procInstId},</if>
|
||||
<if test="recordStatus != null">#{recordStatus},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateUseApply" parameterType="UseApply">
|
||||
update t_use_apply
|
||||
<update id="updateToolApply" parameterType="ToolApply">
|
||||
update t_tool_apply
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="userId != null">user_id = #{userId},</if>
|
||||
<if test="nickName != null">nick_name = #{nickName},</if>
|
||||
<if test="toolId != null">tool_id = #{toolId},</if>
|
||||
<if test="procTitle != null">proc_title = #{procTitle},</if>
|
||||
<if test="applyType != null">apply_type = #{applyType},</if>
|
||||
<if test="deptId != null">dept_id = #{deptId},</if>
|
||||
<if test="deptName != null">dept_name = #{deptName},</if>
|
||||
<if test="reason != null">reason = #{reason},</if>
|
||||
@@ -86,24 +111,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="endTime != null">end_time = #{endTime},</if>
|
||||
<if test="recordStatus != null">record_status = #{recordStatus},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteUseApplyById" parameterType="String">
|
||||
delete from t_use_apply where id = #{id}
|
||||
<delete id="deleteToolApplyById" parameterType="String">
|
||||
delete from t_tool_apply where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteUseApplyByIds" parameterType="String">
|
||||
delete from t_use_apply where id in
|
||||
<delete id="deleteToolApplyByIds" parameterType="String">
|
||||
delete from t_tool_apply where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id="checkUseApply" resultType="int">
|
||||
SELECT count(*) FROM `t_use_apply_item` uai
|
||||
<select id="checkToolApply" resultType="int">
|
||||
SELECT count(*) FROM `t_tool_apply_item` uai
|
||||
left join `t_tool_apply` ua on uai.apply_id = ua.id
|
||||
WHERE ua.record_status = 'done'
|
||||
and uai.tool_id = #{toolId}
|
||||
Reference in New Issue
Block a user