|
@@ -1,7 +1,7 @@
|
|
<?xml version="1.0" encoding="UTF-8" ?>
|
|
<?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">
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
<mapper namespace="com.jeeplus.modules.workreimbursement.dao.WorkReimbursementDao">
|
|
<mapper namespace="com.jeeplus.modules.workreimbursement.dao.WorkReimbursementDao">
|
|
-
|
|
|
|
|
|
+
|
|
<sql id="workReimbursementColumns">
|
|
<sql id="workReimbursementColumns">
|
|
a.id AS "id",
|
|
a.id AS "id",
|
|
a.process_instance_id AS "processInstanceId",
|
|
a.process_instance_id AS "processInstanceId",
|
|
@@ -35,14 +35,14 @@
|
|
a.create_office as "createOffice",
|
|
a.create_office as "createOffice",
|
|
a.type as "type"
|
|
a.type as "type"
|
|
</sql>
|
|
</sql>
|
|
-
|
|
|
|
|
|
+
|
|
<sql id="workReimbursementJoins">
|
|
<sql id="workReimbursementJoins">
|
|
LEFT JOIN rural_project_records p on p.id = a.project_id
|
|
LEFT JOIN rural_project_records p on p.id = a.project_id
|
|
</sql>
|
|
</sql>
|
|
-
|
|
|
|
-
|
|
|
|
|
|
+
|
|
|
|
+
|
|
<select id="get" resultType="WorkReimbursement" >
|
|
<select id="get" resultType="WorkReimbursement" >
|
|
- SELECT
|
|
|
|
|
|
+ SELECT
|
|
<include refid="workReimbursementColumns"/>,
|
|
<include refid="workReimbursementColumns"/>,
|
|
a.money AS "money"
|
|
a.money AS "money"
|
|
,a.office_id as "officeId"
|
|
,a.office_id as "officeId"
|
|
@@ -52,9 +52,9 @@
|
|
left join sys_user su on su.id = a.submitter_id
|
|
left join sys_user su on su.id = a.submitter_id
|
|
WHERE a.id = #{id}
|
|
WHERE a.id = #{id}
|
|
</select>
|
|
</select>
|
|
-
|
|
|
|
|
|
+
|
|
<select id="findList" resultType="WorkReimbursement" >
|
|
<select id="findList" resultType="WorkReimbursement" >
|
|
- SELECT
|
|
|
|
|
|
+ SELECT
|
|
<include refid="workReimbursementColumns"/>
|
|
<include refid="workReimbursementColumns"/>
|
|
,wa.reimbursement_name AS "submitterId"
|
|
,wa.reimbursement_name AS "submitterId"
|
|
,wa.money as "money"
|
|
,wa.money as "money"
|
|
@@ -81,8 +81,14 @@
|
|
<if test="status != '' and status != null">
|
|
<if test="status != '' and status != null">
|
|
AND a.status = #{status}
|
|
AND a.status = #{status}
|
|
</if>
|
|
</if>
|
|
- <if test="officeId != '' and officeId != null">
|
|
|
|
|
|
+ <!--<if test="officeId != '' and officeId != null">
|
|
AND wa.office_id = #{officeId}
|
|
AND wa.office_id = #{officeId}
|
|
|
|
+ </if>-->
|
|
|
|
+ <if test="officeIdList!=null and officeIdList.size!=0">
|
|
|
|
+ and wa.office_id in
|
|
|
|
+ <foreach collection="officeIdList" item="officeId" separator="," open="(" close=")">
|
|
|
|
+ #{officeId}
|
|
|
|
+ </foreach>
|
|
</if>
|
|
</if>
|
|
<if test="submitterDate != '' and submitterDate != null">
|
|
<if test="submitterDate != '' and submitterDate != null">
|
|
AND a.submitter_date = #{submitterDate}
|
|
AND a.submitter_date = #{submitterDate}
|
|
@@ -138,8 +144,14 @@
|
|
<if test="status != '' and status != null">
|
|
<if test="status != '' and status != null">
|
|
AND a.status = #{status}
|
|
AND a.status = #{status}
|
|
</if>
|
|
</if>
|
|
- <if test="officeId != '' and officeId != null">
|
|
|
|
|
|
+ <!--<if test="officeId != '' and officeId != null">
|
|
AND wa.office_id = #{officeId}
|
|
AND wa.office_id = #{officeId}
|
|
|
|
+ </if>-->
|
|
|
|
+ <if test="officeIdList!=null and officeIdList.size!=0">
|
|
|
|
+ and wa.office_id in
|
|
|
|
+ <foreach collection="officeIdList" item="officeId" separator="," open="(" close=")">
|
|
|
|
+ #{officeId}
|
|
|
|
+ </foreach>
|
|
</if>
|
|
</if>
|
|
<if test="submitterDate != '' and submitterDate != null">
|
|
<if test="submitterDate != '' and submitterDate != null">
|
|
AND a.submitter_date = #{submitterDate}
|
|
AND a.submitter_date = #{submitterDate}
|
|
@@ -176,16 +188,16 @@
|
|
</otherwise>
|
|
</otherwise>
|
|
</choose>
|
|
</choose>
|
|
</select>
|
|
</select>
|
|
-
|
|
|
|
|
|
+
|
|
<select id="findAllList" resultType="WorkReimbursement" >
|
|
<select id="findAllList" resultType="WorkReimbursement" >
|
|
- SELECT
|
|
|
|
|
|
+ SELECT
|
|
<include refid="workReimbursementColumns"/>,
|
|
<include refid="workReimbursementColumns"/>,
|
|
a.money AS "money"
|
|
a.money AS "money"
|
|
FROM work_reimbursement a
|
|
FROM work_reimbursement a
|
|
<include refid="workReimbursementJoins"/>
|
|
<include refid="workReimbursementJoins"/>
|
|
<where>
|
|
<where>
|
|
a.del_flag = #{DEL_FLAG_NORMAL}
|
|
a.del_flag = #{DEL_FLAG_NORMAL}
|
|
- </where>
|
|
|
|
|
|
+ </where>
|
|
<choose>
|
|
<choose>
|
|
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
|
|
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
|
|
ORDER BY ${page.orderBy}
|
|
ORDER BY ${page.orderBy}
|
|
@@ -195,13 +207,13 @@
|
|
</otherwise>
|
|
</otherwise>
|
|
</choose>
|
|
</choose>
|
|
</select>
|
|
</select>
|
|
-
|
|
|
|
|
|
+
|
|
<update id="updateProcessInstanceId">
|
|
<update id="updateProcessInstanceId">
|
|
- UPDATE work_reimbursement SET
|
|
|
|
|
|
+ UPDATE work_reimbursement SET
|
|
process_instance_id = #{processInstanceId}
|
|
process_instance_id = #{processInstanceId}
|
|
WHERE id = #{id}
|
|
WHERE id = #{id}
|
|
</update>
|
|
</update>
|
|
-
|
|
|
|
|
|
+
|
|
<insert id="insert">
|
|
<insert id="insert">
|
|
INSERT INTO work_reimbursement(
|
|
INSERT INTO work_reimbursement(
|
|
id,
|
|
id,
|
|
@@ -270,9 +282,9 @@
|
|
|
|
|
|
)
|
|
)
|
|
</insert>
|
|
</insert>
|
|
-
|
|
|
|
|
|
+
|
|
<update id="update">
|
|
<update id="update">
|
|
- UPDATE work_reimbursement SET
|
|
|
|
|
|
+ UPDATE work_reimbursement SET
|
|
number = #{number},
|
|
number = #{number},
|
|
business_type = #{businessType},
|
|
business_type = #{businessType},
|
|
<if test="officeId != null and officeId !=''">
|
|
<if test="officeId != null and officeId !=''">
|
|
@@ -306,27 +318,27 @@
|
|
type = #{type}
|
|
type = #{type}
|
|
WHERE id = #{id}
|
|
WHERE id = #{id}
|
|
</update>
|
|
</update>
|
|
-
|
|
|
|
-
|
|
|
|
|
|
+
|
|
|
|
+
|
|
<!--物理删除-->
|
|
<!--物理删除-->
|
|
<update id="delete">
|
|
<update id="delete">
|
|
DELETE FROM work_reimbursement
|
|
DELETE FROM work_reimbursement
|
|
WHERE id = #{id}
|
|
WHERE id = #{id}
|
|
</update>
|
|
</update>
|
|
-
|
|
|
|
|
|
+
|
|
<!--逻辑删除-->
|
|
<!--逻辑删除-->
|
|
<update id="deleteByLogic">
|
|
<update id="deleteByLogic">
|
|
- UPDATE work_reimbursement SET
|
|
|
|
|
|
+ UPDATE work_reimbursement SET
|
|
del_flag = #{DEL_FLAG_DELETE}
|
|
del_flag = #{DEL_FLAG_DELETE}
|
|
WHERE id = #{id}
|
|
WHERE id = #{id}
|
|
</update>
|
|
</update>
|
|
-
|
|
|
|
-
|
|
|
|
|
|
+
|
|
|
|
+
|
|
<!-- 根据实体名称和字段名称和字段值获取唯一记录 -->
|
|
<!-- 根据实体名称和字段名称和字段值获取唯一记录 -->
|
|
<select id="findUniqueByProperty" resultType="WorkReimbursement" statementType="STATEMENT">
|
|
<select id="findUniqueByProperty" resultType="WorkReimbursement" statementType="STATEMENT">
|
|
select * FROM work_reimbursement where ${propertyName} = '${value}'
|
|
select * FROM work_reimbursement where ${propertyName} = '${value}'
|
|
</select>
|
|
</select>
|
|
-
|
|
|
|
|
|
+
|
|
<select id="findListByproject" resultType="WorkBidProject">
|
|
<select id="findListByproject" resultType="WorkBidProject">
|
|
select
|
|
select
|
|
a.id AS "id",
|
|
a.id AS "id",
|
|
@@ -381,7 +393,7 @@
|
|
<where>
|
|
<where>
|
|
a.del_flag = #{DEL_FLAG_NORMAL}
|
|
a.del_flag = #{DEL_FLAG_NORMAL}
|
|
<if test="name != null and name != ''">
|
|
<if test="name != null and name != ''">
|
|
- AND a.name LIKE
|
|
|
|
|
|
+ AND a.name LIKE
|
|
<if test="dbName == 'oracle'">#{name}||'%'</if>
|
|
<if test="dbName == 'oracle'">#{name}||'%'</if>
|
|
<if test="dbName == 'mssql'">#{name}+'%'</if>
|
|
<if test="dbName == 'mssql'">#{name}+'%'</if>
|
|
<if test="dbName == 'mysql'">concat(#{name},'%')</if>
|
|
<if test="dbName == 'mysql'">concat(#{name},'%')</if>
|
|
@@ -438,4 +450,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-</mapper>
|
|
|
|
|
|
+</mapper>
|