|
@@ -25,10 +25,11 @@
|
|
<result property="auditOpTime" column="audit_op_time"/>
|
|
<result property="auditOpTime" column="audit_op_time"/>
|
|
<result property="auditMsg" column="audit_msg"/>
|
|
<result property="auditMsg" column="audit_msg"/>
|
|
<result property="auditStatus" column="audit_status"/>
|
|
<result property="auditStatus" column="audit_status"/>
|
|
|
|
+ <result property="billTime" column="bill_time"/>
|
|
</resultMap>
|
|
</resultMap>
|
|
|
|
|
|
<sql id="selectAuditItemsVo">
|
|
<sql id="selectAuditItemsVo">
|
|
- select id, bill_no, bill_id, act_id, path_id, level_id, refno1, iffinal_item, refno2, refno3, branch_id, send_user_id, send_name, send_time, send_msg, audit_user_id, audit_item,audit_op_time, audit_msg, audit_status from audit_items
|
|
|
|
|
|
+ select id, bill_no, bill_id, act_id, path_id, level_id, refno1, iffinal_item, refno2, refno3, branch_id, send_user_id, send_name, send_time, send_msg, audit_user_id, audit_item,audit_op_time, audit_msg, audit_status,bill_time from audit_items
|
|
</sql>
|
|
</sql>
|
|
|
|
|
|
<select id="selectAuditItemsList" parameterType="AuditItems" resultMap="AuditItemsResult">
|
|
<select id="selectAuditItemsList" parameterType="AuditItems" resultMap="AuditItemsResult">
|
|
@@ -53,6 +54,7 @@
|
|
<if test="auditOpTime != null ">and audit_op_time = #{auditOpTime}</if>
|
|
<if test="auditOpTime != null ">and audit_op_time = #{auditOpTime}</if>
|
|
<if test="auditMsg != null and auditMsg != ''">and audit_msg = #{auditMsg}</if>
|
|
<if test="auditMsg != null and auditMsg != ''">and audit_msg = #{auditMsg}</if>
|
|
<if test="auditStatus != null and auditStatus != ''">and audit_status = #{auditStatus}</if>
|
|
<if test="auditStatus != null and auditStatus != ''">and audit_status = #{auditStatus}</if>
|
|
|
|
+ <if test="billTime != null "> and bill_time = #{billTime},</if>
|
|
</where>
|
|
</where>
|
|
</select>
|
|
</select>
|
|
|
|
|
|
@@ -83,6 +85,7 @@
|
|
<if test="auditOpTime != null ">audit_op_time,</if>
|
|
<if test="auditOpTime != null ">audit_op_time,</if>
|
|
<if test="auditMsg != null">audit_msg,</if>
|
|
<if test="auditMsg != null">audit_msg,</if>
|
|
<if test="auditStatus != null">audit_status,</if>
|
|
<if test="auditStatus != null">audit_status,</if>
|
|
|
|
+ <if test="billTime != null ">bill_time,</if>
|
|
</trim>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="billNo != null">#{billNo},</if>
|
|
<if test="billNo != null">#{billNo},</if>
|
|
@@ -104,6 +107,7 @@
|
|
<if test="auditOpTime != null ">#{auditOpTime},</if>
|
|
<if test="auditOpTime != null ">#{auditOpTime},</if>
|
|
<if test="auditMsg != null">#{auditMsg},</if>
|
|
<if test="auditMsg != null">#{auditMsg},</if>
|
|
<if test="auditStatus != null">#{auditStatus},</if>
|
|
<if test="auditStatus != null">#{auditStatus},</if>
|
|
|
|
+ <if test="billTime != null ">#{billTime},</if>
|
|
</trim>
|
|
</trim>
|
|
</insert>
|
|
</insert>
|
|
|
|
|
|
@@ -129,6 +133,7 @@
|
|
<if test="auditOpTime != null ">audit_op_time = #{auditOpTime},</if>
|
|
<if test="auditOpTime != null ">audit_op_time = #{auditOpTime},</if>
|
|
<if test="auditMsg != null">audit_msg = #{auditMsg},</if>
|
|
<if test="auditMsg != null">audit_msg = #{auditMsg},</if>
|
|
<if test="auditStatus != null">audit_status = #{auditStatus},</if>
|
|
<if test="auditStatus != null">audit_status = #{auditStatus},</if>
|
|
|
|
+ <if test="billTime != null ">bill_time = #{billTime},</if>
|
|
</trim>
|
|
</trim>
|
|
where id = #{id}
|
|
where id = #{id}
|
|
</update>
|
|
</update>
|
|
@@ -144,19 +149,79 @@
|
|
</foreach>
|
|
</foreach>
|
|
</delete>
|
|
</delete>
|
|
|
|
|
|
|
|
+
|
|
|
|
+ <select id="selectCountAuditItems" resultType="java.lang.Integer">
|
|
|
|
+ SELECT count(*)
|
|
|
|
+ FROM
|
|
|
|
+ audit_items item
|
|
|
|
+ LEFT JOIN t_corps corp ON corp.f_id = item.refno1
|
|
|
|
+ LEFT JOIN audit_items_users us ON us.pid = item.id
|
|
|
|
+ LEFT JOIN sys_user usr ON usr.user_id = item.audit_user_id
|
|
|
|
+ where
|
|
|
|
+ us.audit_status = 'S'
|
|
|
|
+ AND item.audit_status = 'S'
|
|
|
|
+ <if test="billNo != null and billNo != ''"> and item.bill_no = #{billNo}</if>
|
|
|
|
+ <if test="actId != null and actId != ''"> and item.act_id = #{actId}</if>
|
|
|
|
+ <if test="refno2 != null and refno2 != ''"> and item.refno2 = #{refno2}</if>
|
|
|
|
+ <if test="billId != null and billId != ''"> and item.bill_id like concat('%', #{billId}, '%')</if>
|
|
|
|
+ <if test="refno1 != null and refno1 != ''"> and corp.f_name like concat('%', #{refno1}, '%')</if>
|
|
|
|
+ <if test="sendUserId != null and sendUserId != ''"> and item.send_user_id like concat('%', #{sendUserId}, '%')</if>
|
|
|
|
+ <if test="billTime != null and billTime != ''"> and item.bill_time = #{billTime}</if>
|
|
|
|
+ <if test="auditUserId != null and auditUserId != ''"> AND us.user_id = #{auditUserId}</if>
|
|
|
|
+ <if test='sendTime != null and sendTime[0] != null and sendTime[0]!= ""'>
|
|
|
|
+ and item.send_time >= #{sendTime[0]}
|
|
|
|
+ </if>
|
|
|
|
+ <if test='sendTime != null and sendTime[1] != null and sendTime[1]!= ""'>
|
|
|
|
+ and item.send_time <= #{sendTime[1]}
|
|
|
|
+ </if>
|
|
|
|
+ <if test='auditOpTime != null and auditOpTime[0] != null and auditOpTime[0]!= ""'>
|
|
|
|
+ and item.audit_op_time >= #{auditOpTime[0]}
|
|
|
|
+ </if>
|
|
|
|
+ <if test='auditOpTime != null and auditOpTime[1] != null and auditOpTime[1]!= ""'>
|
|
|
|
+ and item.audit_op_time <= #{auditOpTime[1]}
|
|
|
|
+ </if>
|
|
|
|
+ ORDER BY
|
|
|
|
+ item.send_time DESC
|
|
|
|
+ </select>
|
|
|
|
+
|
|
<select id="selectAuditItems" parameterType="AuditItems" resultType="Map">
|
|
<select id="selectAuditItems" parameterType="AuditItems" resultType="Map">
|
|
SELECT
|
|
SELECT
|
|
- item.id,
|
|
|
|
- item.act_id AS actId,
|
|
|
|
- item.bill_id AS billId,
|
|
|
|
- corp.f_name AS refno1,
|
|
|
|
- item.refno2,
|
|
|
|
- item.refno3,
|
|
|
|
- usr.user_name AS auditUserName,
|
|
|
|
- usr.nick_name AS nickName,
|
|
|
|
- item.send_time AS auditItem,
|
|
|
|
- item.audit_msg AS auditMsg,
|
|
|
|
- item.audit_status AS auditStatus
|
|
|
|
|
|
+ item.id,
|
|
|
|
+ CASE
|
|
|
|
+ item.act_id
|
|
|
|
+ WHEN 410 THEN
|
|
|
|
+ '下单审批'
|
|
|
|
+ WHEN 420 THEN
|
|
|
|
+ '配船审批'
|
|
|
|
+ END actId,
|
|
|
|
+ item.bill_id AS billId,
|
|
|
|
+ corp.f_name AS refno1,
|
|
|
|
+ item.refno2,
|
|
|
|
+ item.refno3,
|
|
|
|
+ item.bill_no AS billNo,
|
|
|
|
+ us.user_id AS userId,
|
|
|
|
+ item.audit_item,
|
|
|
|
+ item.audit_user_id AS auditUserId,
|
|
|
|
+ CASE
|
|
|
|
+ item.audit_status
|
|
|
|
+ WHEN 'O' THEN
|
|
|
|
+ '提交'
|
|
|
|
+ WHEN 'N' THEN
|
|
|
|
+ '未知状态'
|
|
|
|
+ WHEN 'S' THEN
|
|
|
|
+ '待审'
|
|
|
|
+ WHEN 'B' THEN
|
|
|
|
+ '审核退回'
|
|
|
|
+ WHEN 'A' THEN
|
|
|
|
+ '审核通过'
|
|
|
|
+ END audit,
|
|
|
|
+ item.send_user_id AS sendUserId,
|
|
|
|
+ usr.user_name AS auditUserName,
|
|
|
|
+ usr.nick_name AS nickName,
|
|
|
|
+ item.send_time AS sendTime,
|
|
|
|
+ item.audit_op_time AS auditOpTime,
|
|
|
|
+ item.bill_time AS billTime,
|
|
|
|
+ item.audit_msg AS auditMsg
|
|
FROM
|
|
FROM
|
|
audit_items item
|
|
audit_items item
|
|
LEFT JOIN t_corps corp ON corp.f_id = item.refno1
|
|
LEFT JOIN t_corps corp ON corp.f_id = item.refno1
|
|
@@ -164,8 +229,27 @@
|
|
LEFT JOIN sys_user usr ON usr.user_id = item.audit_user_id
|
|
LEFT JOIN sys_user usr ON usr.user_id = item.audit_user_id
|
|
where
|
|
where
|
|
us.audit_status = 'S'
|
|
us.audit_status = 'S'
|
|
- AND item.audit_status = 'S'
|
|
|
|
- AND us.user_id = #{auditUserId}
|
|
|
|
|
|
+ <if test="billNo != null and billNo != ''"> and item.bill_no = #{billNo}</if>
|
|
|
|
+ <if test="actId != null and actId != ''"> and item.act_id = #{actId}</if>
|
|
|
|
+ <if test="refno2 != null and refno2 != ''"> and item.refno2 = #{refno2}</if>
|
|
|
|
+ <if test="billId != null and billId != ''"> and item.bill_id like concat('%', #{billId}, '%')</if>
|
|
|
|
+ <if test="refno1 != null and refno1 != ''"> and corp.f_name like concat('%', #{refno1}, '%')</if>
|
|
|
|
+ <if test="sendUserId != null and sendUserId != ''"> and item.send_user_id like concat('%', #{sendUserId}, '%')</if>
|
|
|
|
+ <if test="billTime != null and billTime != ''"> and item.bill_time = #{billTime}</if>
|
|
|
|
+ <if test="auditUserId != null and auditUserId != ''"> AND us.user_id = #{auditUserId}</if>
|
|
|
|
+ <if test='sendTime != null and sendTime[0] != null and sendTime[0]!= ""'>
|
|
|
|
+ and item.send_time >= #{sendTime[0]}
|
|
|
|
+ </if>
|
|
|
|
+ <if test='sendTime != null and sendTime[1] != null and sendTime[1]!= ""'>
|
|
|
|
+ and item.send_time <= #{sendTime[1]}
|
|
|
|
+ </if>
|
|
|
|
+ <if test='auditOpTime != null and auditOpTime[0] != null and auditOpTime[0]!= ""'>
|
|
|
|
+ and item.audit_op_time >= #{auditOpTime[0]}
|
|
|
|
+ </if>
|
|
|
|
+ <if test='auditOpTime != null and auditOpTime[1] != null and auditOpTime[1]!= ""'>
|
|
|
|
+ and item.audit_op_time <= #{auditOpTime[1]}
|
|
|
|
+ </if>
|
|
|
|
+ AND item.audit_status = 'S'
|
|
ORDER BY
|
|
ORDER BY
|
|
item.send_time DESC
|
|
item.send_time DESC
|
|
</select>
|
|
</select>
|
|
@@ -192,6 +276,7 @@
|
|
aud.audit_msg AS auditMsg,
|
|
aud.audit_msg AS auditMsg,
|
|
aud.audit_item AS auditItem,
|
|
aud.audit_item AS auditItem,
|
|
aud.audit_op_time AS auditOpTime
|
|
aud.audit_op_time AS auditOpTime
|
|
|
|
+ aud.bill_time AS billTime,
|
|
FROM
|
|
FROM
|
|
audit_items aud
|
|
audit_items aud
|
|
LEFT JOIN sys_user us ON us.user_id = aud.audit_user_id
|
|
LEFT JOIN sys_user us ON us.user_id = aud.audit_user_id
|