|
@@ -10,6 +10,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
10
|
10
|
<result property="borrowType" column="borrow_type" />
|
11
|
11
|
<result property="applyReason" column="apply_reason" />
|
12
|
12
|
<result property="applier" column="applier" />
|
|
13
|
+ <result property="applyDept" column="apply_dept" />
|
13
|
14
|
<result property="applyDate" column="apply_date" />
|
14
|
15
|
<result property="applyAmount" column="apply_amount" />
|
15
|
16
|
<result property="managerAmount" column="manager_amount" />
|
|
@@ -28,43 +29,66 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
28
|
29
|
<result property="managerTime" column="manager_time" />
|
29
|
30
|
<result property="zjlTime" column="zjl_time" />
|
30
|
31
|
<result property="lendTime" column="lend_time" />
|
|
32
|
+ <association property="applierUser" javaType="SysUser" resultMap="SysUserResult" />
|
|
33
|
+ <association property="dept" javaType="SysDept" resultMap="SysDeptResult" />
|
|
34
|
+ <association property="project" javaType="CmcProject" resultMap="CmcProjectResult" />
|
|
35
|
+ </resultMap>
|
|
36
|
+
|
|
37
|
+ <resultMap type="SysUser" id="SysUserResult">
|
|
38
|
+ <result property="userId" column="user_id" />
|
|
39
|
+ <result property="nickName" column="nick_name" />
|
|
40
|
+ </resultMap>
|
|
41
|
+
|
|
42
|
+ <resultMap type="SysDept" id="SysDeptResult">
|
|
43
|
+ <result property="deptId" column="dept_id" />
|
|
44
|
+ <result property="deptName" column="dept_name" />
|
|
45
|
+ </resultMap>
|
|
46
|
+
|
|
47
|
+ <resultMap type="CmcProject" id="CmcProjectResult">
|
|
48
|
+ <result property="projectId" column="project_id" />
|
|
49
|
+ <result property="projectNumber" column="project_number" />
|
|
50
|
+ <result property="projectName" column="project_name" />
|
31
|
51
|
</resultMap>
|
32
|
52
|
|
33
|
53
|
<sql id="selectCmcBorrowVo">
|
34
|
|
- select borrow_jd, project_id, borrow_type, apply_reason, applier, apply_date, apply_amount, manager_amount, dept_comment, dept_user_id, xm_user_id, xm_comment, manager_comment, manager_user_id, zjl_user_id, zjl_comment, cw_user_id, cw_comment, dept_time, xm_time, manager_time, zjl_time, lend_time from cmc_borrow
|
|
54
|
+ select b.borrow_jd, b.project_id, p.project_number, p.project_name, b.borrow_type, b.apply_reason, b.applier, u.nick_name, d.dept_name, b.apply_date, b.apply_amount, b.manager_amount, b.dept_comment, b.dept_user_id, b.xm_user_id, b.xm_comment, b.manager_comment, b.manager_user_id, b.zjl_user_id, b.zjl_comment, b.cw_user_id, b.cw_comment, b.dept_time, b.xm_time, b.manager_time, b.zjl_time, b.lend_time from cmc_borrow as b
|
|
55
|
+ left join sys_user as u on u.user_id = b.applier
|
|
56
|
+ left join sys_dept as d on d.dept_id = b.apply_dept
|
|
57
|
+ left join cmc_project as p on b.project_id = p.project_id
|
35
|
58
|
</sql>
|
36
|
59
|
|
37
|
60
|
<select id="selectCmcBorrowList" parameterType="CmcBorrow" resultMap="CmcBorrowResult">
|
38
|
61
|
<include refid="selectCmcBorrowVo"/>
|
39
|
62
|
<where>
|
40
|
|
- <if test="projectId != null and projectId != ''"> and project_id = #{projectId}</if>
|
41
|
|
- <if test="borrowType != null and borrowType != ''"> and borrow_type = #{borrowType}</if>
|
42
|
|
- <if test="applyReason != null and applyReason != ''"> and apply_reason = #{applyReason}</if>
|
43
|
|
- <if test="applier != null "> and applier = #{applier}</if>
|
44
|
|
- <if test="applyDate != null "> and apply_date = #{applyDate}</if>
|
45
|
|
- <if test="applyAmount != null "> and apply_amount = #{applyAmount}</if>
|
46
|
|
- <if test="managerAmount != null "> and manager_amount = #{managerAmount}</if>
|
47
|
|
- <if test="deptComment != null and deptComment != ''"> and dept_comment = #{deptComment}</if>
|
48
|
|
- <if test="deptUserId != null "> and dept_user_id = #{deptUserId}</if>
|
49
|
|
- <if test="xmUserId != null "> and xm_user_id = #{xmUserId}</if>
|
50
|
|
- <if test="xmComment != null and xmComment != ''"> and xm_comment = #{xmComment}</if>
|
51
|
|
- <if test="managerComment != null and managerComment != ''"> and manager_comment = #{managerComment}</if>
|
52
|
|
- <if test="managerUserId != null "> and manager_user_id = #{managerUserId}</if>
|
53
|
|
- <if test="zjlUserId != null "> and zjl_user_id = #{zjlUserId}</if>
|
54
|
|
- <if test="zjlComment != null and zjlComment != ''"> and zjl_comment = #{zjlComment}</if>
|
55
|
|
- <if test="cwUserId != null "> and cw_user_id = #{cwUserId}</if>
|
56
|
|
- <if test="cwComment != null and cwComment != ''"> and cw_comment = #{cwComment}</if>
|
57
|
|
- <if test="deptTime != null "> and dept_time = #{deptTime}</if>
|
58
|
|
- <if test="xmTime != null "> and xm_time = #{xmTime}</if>
|
59
|
|
- <if test="managerTime != null "> and manager_time = #{managerTime}</if>
|
60
|
|
- <if test="zjlTime != null "> and zjl_time = #{zjlTime}</if>
|
61
|
|
- <if test="lendTime != null "> and lend_time = #{lendTime}</if>
|
|
63
|
+ <if test="projectId != null and projectId != ''"> and b.project_id = #{projectId}</if>
|
|
64
|
+ <if test="borrowType != null and borrowType != ''"> and b.borrow_type = #{borrowType}</if>
|
|
65
|
+ <if test="applyReason != null and applyReason != ''"> and b.apply_reason = #{applyReason}</if>
|
|
66
|
+ <if test="applyDept != null and applyDept != ''"> and b.apply_dept = #{applyDept}</if>
|
|
67
|
+ <if test="applier != null "> and b.applier = #{applier}</if>
|
|
68
|
+ <if test="applyDate != null "> and b.apply_date = #{applyDate}</if>
|
|
69
|
+ <if test="applyAmount != null "> and b.apply_amount = #{applyAmount}</if>
|
|
70
|
+ <if test="managerAmount != null "> and b.manager_amount = #{managerAmount}</if>
|
|
71
|
+ <if test="deptComment != null and deptComment != ''"> and b.dept_comment = #{deptComment}</if>
|
|
72
|
+ <if test="deptUserId != null "> and b.dept_user_id = #{deptUserId}</if>
|
|
73
|
+ <if test="xmUserId != null "> and b.xm_user_id = #{xmUserId}</if>
|
|
74
|
+ <if test="xmComment != null and xmComment != ''"> and b.xm_comment = #{xmComment}</if>
|
|
75
|
+ <if test="managerComment != null and managerComment != ''"> and b.manager_comment = #{managerComment}</if>
|
|
76
|
+ <if test="managerUserId != null "> and b.manager_user_id = #{managerUserId}</if>
|
|
77
|
+ <if test="zjlUserId != null "> and b.zjl_user_id = #{zjlUserId}</if>
|
|
78
|
+ <if test="zjlComment != null and zjlComment != ''"> and b.zjl_comment = #{zjlComment}</if>
|
|
79
|
+ <if test="cwUserId != null "> and b.cw_user_id = #{cwUserId}</if>
|
|
80
|
+ <if test="cwComment != null and cwComment != ''"> and b.cw_comment = #{cwComment}</if>
|
|
81
|
+ <if test="deptTime != null "> and b.dept_time = #{deptTime}</if>
|
|
82
|
+ <if test="xmTime != null "> and b.xm_time = #{xmTime}</if>
|
|
83
|
+ <if test="managerTime != null "> and b.manager_time = #{managerTime}</if>
|
|
84
|
+ <if test="zjlTime != null "> and b.zjl_time = #{zjlTime}</if>
|
|
85
|
+ <if test="lendTime != null "> and b.lend_time = #{lendTime}</if>
|
62
|
86
|
</where>
|
63
|
87
|
</select>
|
64
|
88
|
|
65
|
89
|
<select id="selectCmcBorrowByBorrowJd" parameterType="String" resultMap="CmcBorrowResult">
|
66
|
90
|
<include refid="selectCmcBorrowVo"/>
|
67
|
|
- where borrow_jd = #{borrowJd}
|
|
91
|
+ where b.borrow_jd = #{borrowJd}
|
68
|
92
|
</select>
|
69
|
93
|
|
70
|
94
|
<insert id="insertCmcBorrow" parameterType="CmcBorrow">
|
|
@@ -75,6 +99,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
75
|
99
|
<if test="borrowType != null">borrow_type,</if>
|
76
|
100
|
<if test="applyReason != null">apply_reason,</if>
|
77
|
101
|
<if test="applier != null">applier,</if>
|
|
102
|
+ <if test="applyDept != null">apply_dept,</if>
|
78
|
103
|
<if test="applyDate != null">apply_date,</if>
|
79
|
104
|
<if test="applyAmount != null">apply_amount,</if>
|
80
|
105
|
<if test="managerAmount != null">manager_amount,</if>
|
|
@@ -100,6 +125,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
100
|
125
|
<if test="borrowType != null">#{borrowType},</if>
|
101
|
126
|
<if test="applyReason != null">#{applyReason},</if>
|
102
|
127
|
<if test="applier != null">#{applier},</if>
|
|
128
|
+ <if test="applyDept != null">#{applyDept},</if>
|
103
|
129
|
<if test="applyDate != null">#{applyDate},</if>
|
104
|
130
|
<if test="applyAmount != null">#{applyAmount},</if>
|
105
|
131
|
<if test="managerAmount != null">#{managerAmount},</if>
|
|
@@ -128,6 +154,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
128
|
154
|
<if test="borrowType != null">borrow_type = #{borrowType},</if>
|
129
|
155
|
<if test="applyReason != null">apply_reason = #{applyReason},</if>
|
130
|
156
|
<if test="applier != null">applier = #{applier},</if>
|
|
157
|
+ <if test="applyDept != null">apply_dept = #{applyDept},</if>
|
131
|
158
|
<if test="applyDate != null">apply_date = #{applyDate},</if>
|
132
|
159
|
<if test="applyAmount != null">apply_amount = #{applyAmount},</if>
|
133
|
160
|
<if test="managerAmount != null">manager_amount = #{managerAmount},</if>
|