|
@@ -1,7 +1,7 @@
|
|
|
<?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.jeeplus.modules.workreimbursement.dao.WorkAccountDao">
|
|
|
-
|
|
|
+
|
|
|
<sql id="workAccountColumns">
|
|
|
a.id AS "id",
|
|
|
a.type AS "type",
|
|
@@ -24,13 +24,13 @@
|
|
|
a.reimburse_remarks as "reimburseRemarks",
|
|
|
a.reimbursement_name as "reimbursementUserId"
|
|
|
</sql>
|
|
|
-
|
|
|
+
|
|
|
<sql id="workAccountJoins">
|
|
|
</sql>
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
<select id="get" resultType="WorkAccount" >
|
|
|
- SELECT
|
|
|
+ SELECT
|
|
|
<include refid="workAccountColumns"/>
|
|
|
,su.name as "reimbursementName"
|
|
|
,so.name as "officeId"
|
|
@@ -46,9 +46,9 @@
|
|
|
left join work_reimbursement_type_info t on a.type = t.id
|
|
|
WHERE a.id = #{id}
|
|
|
</select>
|
|
|
-
|
|
|
+
|
|
|
<select id="findList" resultType="WorkAccount" >
|
|
|
- SELECT
|
|
|
+ SELECT
|
|
|
<include refid="workAccountColumns"/>
|
|
|
,su.name as "reimbursementName"
|
|
|
,so.name as "officeId"
|
|
@@ -88,13 +88,13 @@
|
|
|
</select>
|
|
|
|
|
|
<select id="findAllList" resultType="WorkAccount" >
|
|
|
- SELECT
|
|
|
+ SELECT
|
|
|
<include refid="workAccountColumns"/>
|
|
|
FROM work_account a
|
|
|
<include refid="workAccountJoins"/>
|
|
|
<where>
|
|
|
a.del_flag = #{DEL_FLAG_NORMAL}
|
|
|
- </where>
|
|
|
+ </where>
|
|
|
<choose>
|
|
|
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
|
|
|
ORDER BY ${page.orderBy}
|
|
@@ -104,7 +104,7 @@
|
|
|
</otherwise>
|
|
|
</choose>
|
|
|
</select>
|
|
|
-
|
|
|
+
|
|
|
<insert id="insert">
|
|
|
INSERT INTO work_account(
|
|
|
id,
|
|
@@ -165,7 +165,7 @@
|
|
|
DELETE FROM work_account_audit
|
|
|
WHERE work_account_id = #{id}
|
|
|
</update>
|
|
|
-
|
|
|
+
|
|
|
<update id="update">
|
|
|
UPDATE work_account SET
|
|
|
<if test="type != null and type != ''">
|
|
@@ -213,8 +213,8 @@
|
|
|
update_date = #{updateDate}
|
|
|
WHERE id = #{id}
|
|
|
</update>
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
<!--物理删除-->
|
|
|
<update id="delete">
|
|
|
DELETE FROM work_account
|
|
@@ -227,10 +227,10 @@
|
|
|
</otherwise>
|
|
|
</choose>
|
|
|
</update>
|
|
|
-
|
|
|
+
|
|
|
<!--逻辑删除-->
|
|
|
<update id="deleteByLogic">
|
|
|
- UPDATE work_account SET
|
|
|
+ UPDATE work_account SET
|
|
|
del_flag = #{DEL_FLAG_DELETE}
|
|
|
<choose>
|
|
|
<when test="id !=null and id != ''">
|
|
@@ -241,11 +241,17 @@
|
|
|
</otherwise>
|
|
|
</choose>
|
|
|
</update>
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
<!-- 根据实体名称和字段名称和字段值获取唯一记录 -->
|
|
|
<select id="findUniqueByProperty" resultType="WorkAccount" statementType="STATEMENT">
|
|
|
select * FROM work_account where ${propertyName} = '${value}'
|
|
|
</select>
|
|
|
-
|
|
|
-</mapper>
|
|
|
+
|
|
|
+
|
|
|
+ <!-- 根据id查询parentIds信息 -->
|
|
|
+ <select id="getParentIdsById" resultType="java.lang.String">
|
|
|
+ select parent_ids as "parentIds" from work_reimbursement_type_info where id = #{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+</mapper>
|