| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156 |
- <?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.ruoyi.oa.mapper.CmcProcureApprovalMapper">
-
- <resultMap type="CmcProcureApproval" id="CmcProcureApprovalResult">
- <result property="procureApplyId" column="procure_apply_id" />
- <result property="applyReason" column="apply_reason" />
- <result property="applier" column="applier" />
- <result property="applyDept" column="apply_dept" />
- <result property="applyTime" column="apply_time" />
- <result property="managerUserId" column="manager_user_id" />
- <result property="managerComment" column="manager_comment" />
- <result property="managerTime" column="manager_time" />
- <result property="zjlUserId" column="zjl_user_id" />
- <result property="zjlComment" column="zjl_comment" />
- <result property="zjlTime" column="zjl_time" />
- <result property="planUserId" column="plan_user_id" />
- <result property="planTime" column="plan_time" />
- <result property="planComment" column="plan_comment" />
- <association property="applierUser" javaType="SysUser" resultMap="ApplierUserResult" />
- <association property="managerUser" javaType="SysUser" resultMap="ManagerUserResult" />
- <association property="zjlUser" javaType="SysUser" resultMap="ZjlUserResult" />
- <association property="planUser" javaType="SysUser" resultMap="PlanUserResult" />
- <association property="dept" javaType="SysDept" resultMap="SysDeptResult" />
- </resultMap>
-
- <resultMap type="SysUser" id="ApplierUserResult">
- <result property="userId" column="user_id" />
- <result property="nickName" column="applier_nick_name" />
- </resultMap>
-
- <resultMap type="SysUser" id="ManagerUserResult">
- <result property="userId" column="user_id" />
- <result property="nickName" column="manager_nick_name" />
- </resultMap>
-
- <resultMap type="SysUser" id="ZjlUserResult">
- <result property="userId" column="user_id" />
- <result property="nickName" column="zjl_nick_name" />
- </resultMap>
-
- <resultMap type="SysUser" id="PlanUserResult">
- <result property="userId" column="user_id" />
- <result property="nickName" column="plan_nick_name" />
- </resultMap>
-
- <resultMap type="SysDept" id="SysDeptResult">
- <result property="deptId" column="dept_id" />
- <result property="deptName" column="dept_name" />
- </resultMap>
-
- <sql id="selectCmcProcureApprovalVo">
- select pa.procure_apply_id, pa.apply_reason, pa.applier, u.nick_name as applier_nick_name, pa.apply_dept, d.dept_name, pa.apply_time,
- pa.manager_user_id, u1.nick_name as manager_nick_name, pa.manager_comment, pa.manager_time, pa.zjl_user_id, u2.nick_name as zjl_nick_name,
- pa.zjl_comment, pa.zjl_time, pa.plan_user_id, u3.nick_name as plan_nick_name, pa.plan_time, pa.plan_comment from cmc_procure_approval as pa
- left join sys_user as u on u.user_id = pa.applier
- left join sys_user as u1 on u1.user_id = pa.manager_user_id
- left join sys_user as u2 on u2.user_id = pa.zjl_user_id
- left join sys_user as u3 on u3.user_id = pa.plan_user_id
- left join sys_dept as d on d.dept_id = pa.apply_dept
- </sql>
-
- <select id="selectCmcProcureApprovalList" parameterType="CmcProcureApproval" resultMap="CmcProcureApprovalResult">
- <include refid="selectCmcProcureApprovalVo"/>
- <where>
- <if test="applyReason != null and applyReason != ''"> and pa.apply_reason = #{applyReason}</if>
- <if test="applier != null "> and pa.applier = #{applier}</if>
- <if test="applyDept != null "> and pa.apply_dept = #{applyDept}</if>
- <if test="applyTime != null "> and pa.apply_time = #{applyTime}</if>
- <if test="managerUserId != null "> and pa.manager_user_id = #{managerUserId}</if>
- <if test="managerComment != null and managerComment != ''"> and pa.manager_comment = #{managerComment}</if>
- <if test="managerTime != null "> and pa.manager_time = #{managerTime}</if>
- <if test="zjlUserId != null "> and pa.zjl_user_id = #{zjlUserId}</if>
- <if test="zjlComment != null and zjlComment != ''"> and pa.zjl_comment = #{zjlComment}</if>
- <if test="zjlTime != null "> and pa.zjl_time = #{zjlTime}</if>
- <if test="planUserId != null "> and pa.plan_user_id = #{planUserId}</if>
- <if test="planTime != null "> and pa.plan_time = #{planTime}</if>
- <if test="planComment != null and planComment != ''"> and pa.plan_comment = #{planComment}</if>
- </where>
- order by pa.apply_time desc
- </select>
-
- <select id="selectCmcProcureApprovalByProcureApplyId" parameterType="String" resultMap="CmcProcureApprovalResult">
- <include refid="selectCmcProcureApprovalVo"/>
- where pa.procure_apply_id = #{procureApplyId}
- </select>
-
- <insert id="insertCmcProcureApproval" parameterType="CmcProcureApproval">
- insert into cmc_procure_approval
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="procureApplyId != null">procure_apply_id,</if>
- <if test="applyReason != null">apply_reason,</if>
- <if test="applier != null">applier,</if>
- <if test="applyDept != null">apply_dept,</if>
- <if test="applyTime != null">apply_time,</if>
- <if test="managerUserId != null">manager_user_id,</if>
- <if test="managerComment != null">manager_comment,</if>
- <if test="managerTime != null">manager_time,</if>
- <if test="zjlUserId != null">zjl_user_id,</if>
- <if test="zjlComment != null">zjl_comment,</if>
- <if test="zjlTime != null">zjl_time,</if>
- <if test="planUserId != null">plan_user_id,</if>
- <if test="planTime != null">plan_time,</if>
- <if test="planComment != null">plan_comment,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="procureApplyId != null">#{procureApplyId},</if>
- <if test="applyReason != null">#{applyReason},</if>
- <if test="applier != null">#{applier},</if>
- <if test="applyDept != null">#{applyDept},</if>
- <if test="applyTime != null">#{applyTime},</if>
- <if test="managerUserId != null">#{managerUserId},</if>
- <if test="managerComment != null">#{managerComment},</if>
- <if test="managerTime != null">#{managerTime},</if>
- <if test="zjlUserId != null">#{zjlUserId},</if>
- <if test="zjlComment != null">#{zjlComment},</if>
- <if test="zjlTime != null">#{zjlTime},</if>
- <if test="planUserId != null">#{planUserId},</if>
- <if test="planTime != null">#{planTime},</if>
- <if test="planComment != null">#{planComment},</if>
- </trim>
- </insert>
-
- <update id="updateCmcProcureApproval" parameterType="CmcProcureApproval">
- update cmc_procure_approval
- <trim prefix="SET" suffixOverrides=",">
- <if test="applyReason != null">apply_reason = #{applyReason},</if>
- <if test="applier != null">applier = #{applier},</if>
- <if test="applyDept != null">apply_dept = #{applyDept},</if>
- <if test="applyTime != null">apply_time = #{applyTime},</if>
- <if test="managerUserId != null">manager_user_id = #{managerUserId},</if>
- <if test="managerComment != null">manager_comment = #{managerComment},</if>
- <if test="managerTime != null">manager_time = #{managerTime},</if>
- <if test="zjlUserId != null">zjl_user_id = #{zjlUserId},</if>
- <if test="zjlComment != null">zjl_comment = #{zjlComment},</if>
- <if test="zjlTime != null">zjl_time = #{zjlTime},</if>
- <if test="planUserId != null">plan_user_id = #{planUserId},</if>
- <if test="planTime != null">plan_time = #{planTime},</if>
- <if test="planComment != null">plan_comment = #{planComment},</if>
- </trim>
- where procure_apply_id = #{procureApplyId}
- </update>
-
- <delete id="deleteCmcProcureApprovalByProcureApplyId" parameterType="String">
- delete from cmc_procure_approval where procure_apply_id = #{procureApplyId}
- </delete>
-
- <delete id="deleteCmcProcureApprovalByProcureApplyIds" parameterType="String">
- delete from cmc_procure_approval where procure_apply_id in
- <foreach item="procureApplyId" collection="array" open="(" separator="," close=")">
- #{procureApplyId}
- </foreach>
- </delete>
- </mapper>
|