123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185 |
- <?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.CmcCarApprovalMapper">
-
- <resultMap type="CmcCarApproval" id="CmcCarApprovalResult">
- <result property="carApplyId" column="car_apply_id" />
- <result property="applier" column="applier" />
- <result property="useDept" column="use_dept" />
- <result property="cars" column="cars" />
- <result property="drivers" column="drivers" />
- <result property="projectId" column="project_id" />
- <result property="applyReason" column="apply_reason" />
- <result property="passengers" column="passengers" />
- <result property="applyDate" column="apply_date" />
- <result property="beginDate" column="begin_date" />
- <result property="beginHalfday" column="begin_halfday" />
- <result property="endDate" column="end_date" />
- <result property="endHalfday" column="end_halfday" />
- <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="unionUserId" column="union_user_id" />
- <result property="unionComment" column="union_comment" />
- <result property="dispatcher" column="dispatcher" />
- <result property="dispatchComment" column="dispatch_comment" />
- <result property="estimateCost" column="estimate_cost" />
- <association property="applierUser" javaType="SysUser" resultMap="SysUserResult" />
- <association property="dept" javaType="SysDept" resultMap="SysDeptResult" />
- <association property="project" javaType="CmcProject" resultMap="CmcProjectResult" />
- </resultMap>
-
- <resultMap type="SysUser" id="SysUserResult">
- <result property="userId" column="user_id" />
- <result property="nickName" column="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="selectCmcCarApprovalVo">
- select ca.car_apply_id, ca.applier, u.nick_name, ca.use_dept, d.dept_name, ca.cars, ca.drivers, ca.project_id, p.project_number, p.project_name, ca.apply_reason, ca.passengers, ca.apply_date, ca.begin_date, ca.begin_halfday, ca.end_date, ca.end_halfday, ca.days, ca.dept_user_id, ca.dept_comment, ca.manager_user_id, ca.manager_comment, ca.union_user_id, ca.union_comment, ca.dispatcher, ca.dispatch_comment, ca.estimate_cost from cmc_car_approval as ca
- left join sys_user as u on u.user_id = ca.applier
- left join sys_dept as d on d.dept_id = ca.use_dept
- left join cmc_project as p on ca.project_id = p.project_id
- </sql>
-
- <select id="selectCmcCarApprovalList" parameterType="CmcCarApproval" resultMap="CmcCarApprovalResult">
- <include refid="selectCmcCarApprovalVo"/>
- <where>
- <if test="applier != null "> and ca.applier = #{applier}</if>
- <if test="useDept != null "> and ca.use_dept = #{useDept}</if>
- <if test="cars != null and cars != ''"> and ca.cars = #{cars}</if>
- <if test="drivers != null and drivers != ''"> and ca.drivers = #{drivers}</if>
- <if test="projectId != null and projectId != ''"> and ca.project_id = #{projectId}</if>
- <if test="applyReason != null and applyReason != ''"> and ca.apply_reason = #{applyReason}</if>
- <if test="passengers != null "> and ca.passengers = #{passengers}</if>
- <if test="applyDate != null "> and ca.apply_date = #{beginDate}</if>
- <if test="beginDate != null "> and ca.begin_date = #{beginDate}</if>
- <if test="beginHalfday != null and beginHalfday != ''"> and ca.begin_halfday = #{beginHalfday}</if>
- <if test="endDate != null "> and ca.end_date = #{endDate}</if>
- <if test="endHalfday != null and endHalfday != ''"> and ca.end_halfday = #{endHalfday}</if>
- <if test="days != null "> and ca.days = #{days}</if>
- <if test="deptUserId != null "> and ca.dept_user_id = #{deptUserId}</if>
- <if test="deptComment != null and deptComment != ''"> and ca.dept_comment = #{deptComment}</if>
- <if test="managerUserId != null "> and ca.manager_user_id = #{managerUserId}</if>
- <if test="managerComment != null and managerComment != ''"> and ca.manager_comment = #{managerComment}</if>
- <if test="unionUserId != null "> and ca.union_user_id = #{unionUserId}</if>
- <if test="unionComment != null and unionComment != ''"> and ca.union_comment = #{unionComment}</if>
- <if test="dispatcher != null "> and ca.dispatcher = #{dispatcher}</if>
- <if test="dispatchComment != null and dispatchComment != ''"> and ca.dispatch_comment = #{dispatchComment}</if>
- <if test="estimateCost != null "> and ca.estimate_cost = #{estimateCost}</if>
- </where>
- </select>
-
- <select id="selectCmcCarApprovalByCarApplyId" parameterType="String" resultMap="CmcCarApprovalResult">
- <include refid="selectCmcCarApprovalVo"/>
- where car_apply_id = #{carApplyId}
- </select>
-
- <insert id="insertCmcCarApproval" parameterType="CmcCarApproval">
- insert into cmc_car_approval
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="carApplyId != null">car_apply_id,</if>
- <if test="applier != null">applier,</if>
- <if test="useDept != null">use_dept,</if>
- <if test="cars != null">cars,</if>
- <if test="drivers != null">drivers,</if>
- <if test="projectId != null">project_id,</if>
- <if test="applyReason != null">apply_reason,</if>
- <if test="passengers != null">passengers,</if>
- <if test="applyDate != null">apply_date,</if>
- <if test="beginDate != null">begin_date,</if>
- <if test="beginHalfday != null">begin_halfday,</if>
- <if test="endDate != null">end_date,</if>
- <if test="endHalfday != null">end_halfday,</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="unionUserId != null">union_user_id,</if>
- <if test="unionComment != null">union_comment,</if>
- <if test="dispatcher != null">dispatcher,</if>
- <if test="dispatchComment != null">dispatch_comment,</if>
- <if test="estimateCost != null">estimate_cost,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="carApplyId != null">#{carApplyId},</if>
- <if test="applier != null">#{applier},</if>
- <if test="useDept != null">#{useDept},</if>
- <if test="cars != null">#{cars},</if>
- <if test="drivers != null">#{drivers},</if>
- <if test="projectId != null">#{projectId},</if>
- <if test="applyReason != null">#{applyReason},</if>
- <if test="passengers != null">#{passengers},</if>
- <if test="applyDate != null">#{applyDate},</if>
- <if test="beginDate != null">#{beginDate},</if>
- <if test="beginHalfday != null">#{beginHalfday},</if>
- <if test="endDate != null">#{endDate},</if>
- <if test="endHalfday != null">#{endHalfday},</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="unionUserId != null">#{unionUserId},</if>
- <if test="unionComment != null">#{unionComment},</if>
- <if test="dispatcher != null">#{dispatcher},</if>
- <if test="dispatchComment != null">#{dispatchComment},</if>
- <if test="estimateCost != null">#{estimateCost},</if>
- </trim>
- </insert>
-
- <update id="updateCmcCarApproval" parameterType="CmcCarApproval">
- update cmc_car_approval
- <trim prefix="SET" suffixOverrides=",">
- <if test="applier != null">applier = #{applier},</if>
- <if test="useDept != null">use_dept = #{useDept},</if>
- <if test="cars != null">cars = #{cars},</if>
- <if test="drivers != null">drivers = #{drivers},</if>
- <if test="projectId != null">project_id = #{projectId},</if>
- <if test="applyReason != null">apply_reason = #{applyReason},</if>
- <if test="passengers != null">passengers = #{passengers},</if>
- <if test="applyDate != null">apply_date = #{applyDate},</if>
- <if test="beginDate != null">begin_date = #{beginDate},</if>
- <if test="beginHalfday != null">begin_halfday = #{beginHalfday},</if>
- <if test="endDate != null">end_date = #{endDate},</if>
- <if test="endHalfday != null">end_halfday = #{endHalfday},</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="unionUserId != null">union_user_id = #{unionUserId},</if>
- <if test="unionComment != null">union_comment = #{unionComment},</if>
- <if test="dispatcher != null">dispatcher = #{dispatcher},</if>
- <if test="dispatchComment != null">dispatch_comment = #{dispatchComment},</if>
- <if test="estimateCost != null">estimate_cost = #{estimateCost},</if>
- </trim>
- where car_apply_id = #{carApplyId}
- </update>
-
- <delete id="deleteCmcCarApprovalByCarApplyId" parameterType="String">
- delete from cmc_car_approval where car_apply_id = #{carApplyId}
- </delete>
-
- <delete id="deleteCmcCarApprovalByCarApplyIds" parameterType="String">
- delete from cmc_car_approval where car_apply_id in
- <foreach item="carApplyId" collection="array" open="(" separator="," close=")">
- #{carApplyId}
- </foreach>
- </delete>
- </mapper>
|