123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207 |
- <?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.CmcDeviceApprovalMapper">
-
- <resultMap type="CmcDeviceApproval" id="CmcDeviceApprovalResult">
- <result property="deviceApplyId" column="device_apply_id" />
- <result property="applier" column="applier" />
- <result property="useDept" column="use_dept" />
- <result property="devices" column="devices" />
- <result property="projectId" column="project_id" />
- <result property="applyReason" column="apply_reason" />
- <result property="applyDate" column="apply_date" />
- <result property="returnDate" column="return_date" />
- <result property="beginDate" column="begin_date" />
- <result property="endDate" column="end_date" />
- <result property="days" column="days" />
- <result property="deptUserId" column="dept_user_id" />
- <result property="deptComment" column="dept_comment" />
- <result property="managerUserId" column="manager_user_id" />
- <result property="managerComment" column="manager_comment" />
- <result property="dispatcher" column="dispatcher" />
- <result property="dispatchComment" column="dispatch_comment" />
- <result property="estimateCost" column="estimate_cost" />
- <result property="remark" column="remark" />
- <result property="state" column="state" />
- <result property="deptTime" column="dept_time" />
- <result property="managerTime" column="manager_time" />
- <result property="dispatchTime" column="dispatch_time" />
- <association property="applierUser" javaType="SysUser" resultMap="SysUserResult" />
- <association property="dept" javaType="SysDept" resultMap="SysDeptResult" />
- <association property="project" javaType="CmcProject" resultMap="CmcProjectResult" />
- <association property="deptUser" javaType="SysUser" resultMap="DeptUserResult" />
- <association property="managerUser" javaType="SysUser" resultMap="ManagerUserResult" />
- <association property="dispatchUser" javaType="SysUser" resultMap="DispatchUserResult" />
- </resultMap>
-
- <resultMap type="SysUser" id="SysUserResult">
- <result property="userId" column="user_id" />
- <result property="nickName" column="applier_nick_name" />
- </resultMap>
-
- <resultMap type="SysUser" id="DeptUserResult">
- <result property="userId" column="user_id" />
- <result property="nickName" column="dept_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="DispatchUserResult">
- <result property="userId" column="user_id" />
- <result property="nickName" column="dispatch_nick_name" />
- </resultMap>
-
- <resultMap type="SysDept" id="SysDeptResult">
- <result property="deptId" column="dept_id" />
- <result property="deptName" column="dept_name" />
- </resultMap>
-
- <resultMap type="CmcProject" id="CmcProjectResult">
- <result property="projectId" column="project_id" />
- <result property="projectNumber" column="project_number" />
- <result property="projectName" column="project_name" />
- </resultMap>
-
- <sql id="selectCmcDeviceApprovalVo">
- select da.device_apply_id, da.applier, u.nick_name as applier_nick_name, da.use_dept, d.dept_name, da.devices, da.project_id, p.project_number, p.project_name,
- da.apply_reason, da.apply_date, da.return_date, da.begin_date, da.end_date, da.days, da.dept_user_id, u1.nick_name as dept_nick_name, da.state,
- da.dept_comment, da.manager_user_id, u2.nick_name as manager_nick_name, da.manager_comment, da.dispatcher, u3.nick_name as dispatch_nick_name, da.dispatch_comment,
- da.estimate_cost, da.remark, da.dept_time, da.manager_time, da.dispatch_time from cmc_device_approval as da
- left join sys_user as u on u.user_id = da.applier
- left join sys_user as u1 on u1.user_id = da.dept_user_id
- left join sys_user as u2 on u2.user_id = da.manager_user_id
- left join sys_user as u3 on u3.user_id = da.dispatcher
- left join sys_dept as d on d.dept_id = da.use_dept
- left join cmc_project as p on da.project_id = p.project_id
- </sql>
-
- <select id="selectCmcDeviceApprovalList" parameterType="CmcDeviceApproval" resultMap="CmcDeviceApprovalResult">
- <include refid="selectCmcDeviceApprovalVo"/>
- <where>
- <if test="applier != null "> and da.applier = #{applier}</if>
- <if test="useDept != null "> and da.use_dept = #{useDept}</if>
- <if test="devices != null and devices != ''"> and da.devices = #{devices}</if>
- <if test="projectId != null and projectId != ''"> and da.project_id = #{projectId}</if>
- <if test="applyReason != null and applyReason != ''"> and da.apply_reason = #{applyReason}</if>
- <if test="applyDate != null "> and da.apply_date = #{applyDate}</if>
- <if test="returnDate != null "> and da.return_date = #{returnDate}</if>
- <if test="beginDate != null "> and da.begin_date = #{beginDate}</if>
- <if test="endDate != null "> and da.end_date = #{endDate}</if>
- <if test="days != null "> and da.days = #{days}</if>
- <if test="deptUserId != null "> and da.dept_user_id = #{deptUserId}</if>
- <if test="deptComment != null and deptComment != ''"> and da.dept_comment = #{deptComment}</if>
- <if test="managerUserId != null "> and da.manager_user_id = #{managerUserId}</if>
- <if test="managerComment != null and managerComment != ''"> and da.manager_comment = #{managerComment}</if>
- <if test="dispatcher != null "> and da.dispatcher = #{dispatcher}</if>
- <if test="dispatchComment != null and dispatchComment != ''"> and da.dispatch_comment = #{dispatchComment}</if>
- <if test="estimateCost != null "> and da.estimate_cost = #{estimateCost}</if>
- <if test="deptTime != null "> and da.dept_time = #{deptTime}</if>
- <if test="managerTime != null "> and da.manager_time = #{managerTime}</if>
- <if test="dispatchTime != null "> and da.dispatch_time = #{dispatchTime}</if>
- </where>
- </select>
-
- <select id="selectCmcDeviceApprovalByDeviceApplyId" parameterType="String" resultMap="CmcDeviceApprovalResult">
- <include refid="selectCmcDeviceApprovalVo"/>
- where da.device_apply_id = #{deviceApplyId}
- </select>
-
- <insert id="insertCmcDeviceApproval" parameterType="CmcDeviceApproval">
- insert into cmc_device_approval
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="deviceApplyId != null">device_apply_id,</if>
- <if test="applier != null">applier,</if>
- <if test="useDept != null">use_dept,</if>
- <if test="devices != null">devices,</if>
- <if test="projectId != null">project_id,</if>
- <if test="applyReason != null">apply_reason,</if>
- <if test="applyDate != null">apply_date,</if>
- <if test="returnDate != null">return_date,</if>
- <if test="beginDate != null">begin_date,</if>
- <if test="endDate != null">end_date,</if>
- <if test="days != null">days,</if>
- <if test="deptUserId != null">dept_user_id,</if>
- <if test="deptComment != null">dept_comment,</if>
- <if test="managerUserId != null">manager_user_id,</if>
- <if test="managerComment != null">manager_comment,</if>
- <if test="dispatcher != null">dispatcher,</if>
- <if test="dispatchComment != null">dispatch_comment,</if>
- <if test="estimateCost != null">estimate_cost,</if>
- <if test="remark != null">remark,</if>
- <if test="state != null">state,</if>
- <if test="deptTime != null">dept_time,</if>
- <if test="managerTime != null">manager_time,</if>
- <if test="dispatchTime != null">dispatch_time,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="deviceApplyId != null">#{deviceApplyId},</if>
- <if test="applier != null">#{applier},</if>
- <if test="useDept != null">#{useDept},</if>
- <if test="devices != null">#{devices},</if>
- <if test="projectId != null">#{projectId},</if>
- <if test="applyReason != null">#{applyReason},</if>
- <if test="applyDate != null">#{applyDate},</if>
- <if test="returnDate != null">#{returnDate},</if>
- <if test="beginDate != null">#{beginDate},</if>
- <if test="endDate != null">#{endDate},</if>
- <if test="days != null">#{days},</if>
- <if test="deptUserId != null">#{deptUserId},</if>
- <if test="deptComment != null">#{deptComment},</if>
- <if test="managerUserId != null">#{managerUserId},</if>
- <if test="managerComment != null">#{managerComment},</if>
- <if test="dispatcher != null">#{dispatcher},</if>
- <if test="dispatchComment != null">#{dispatchComment},</if>
- <if test="estimateCost != null">#{estimateCost},</if>
- <if test="remark != null">#{remark},</if>
- <if test="state != null">#{state},</if>
- <if test="deptTime != null">#{deptTime},</if>
- <if test="managerTime != null">#{managerTime},</if>
- <if test="dispatchTime != null">#{dispatchTime},</if>
- </trim>
- </insert>
-
- <update id="updateCmcDeviceApproval" parameterType="CmcDeviceApproval">
- update cmc_device_approval
- <trim prefix="SET" suffixOverrides=",">
- <if test="applier != null">applier = #{applier},</if>
- <if test="useDept != null">use_dept = #{useDept},</if>
- <if test="devices != null">devices = #{devices},</if>
- <if test="projectId != null">project_id = #{projectId},</if>
- <if test="applyReason != null">apply_reason = #{applyReason},</if>
- <if test="applyDate != null">apply_date = #{applyDate},</if>
- <if test="returnDate != null">return_date = #{returnDate},</if>
- <if test="beginDate != null">begin_date = #{beginDate},</if>
- <if test="endDate != null">end_date = #{endDate},</if>
- <if test="days != null">days = #{days},</if>
- <if test="deptUserId != null">dept_user_id = #{deptUserId},</if>
- <if test="deptComment != null">dept_comment = #{deptComment},</if>
- <if test="managerUserId != null">manager_user_id = #{managerUserId},</if>
- <if test="managerComment != null">manager_comment = #{managerComment},</if>
- <if test="dispatcher != null">dispatcher = #{dispatcher},</if>
- <if test="dispatchComment != null">dispatch_comment = #{dispatchComment},</if>
- <if test="estimateCost != null">estimate_cost = #{estimateCost},</if>
- <if test="remark != null">remark = #{remark},</if>
- <if test="state != null">state = #{state},</if>
- <if test="deptTime != null">dept_time = #{deptTime},</if>
- <if test="managerTime != null">manager_time = #{managerTime},</if>
- <if test="dispatchTime != null">dispatch_time = #{dispatchTime},</if>
- </trim>
- where device_apply_id = #{deviceApplyId}
- </update>
-
- <delete id="deleteCmcDeviceApprovalByDeviceApplyId" parameterType="String">
- delete from cmc_device_approval where device_apply_id = #{deviceApplyId}
- </delete>
-
- <delete id="deleteCmcDeviceApprovalByDeviceApplyIds" parameterType="String">
- delete from cmc_device_approval where device_apply_id in
- <foreach item="deviceApplyId" collection="array" open="(" separator="," close=")">
- #{deviceApplyId}
- </foreach>
- </delete>
- </mapper>
|