|
|
@@ -20,11 +20,15 @@
|
|
|
<result column="working_hours_type" jdbcType="INTEGER" property="workingHoursType" />
|
|
|
<result column="hide_sign" jdbcType="INTEGER" property="hideSign" />
|
|
|
<result column="lvl" jdbcType="INTEGER" property="lvl" />
|
|
|
+ <result column="current_amount" jdbcType="DECIMAL" property="currentAmount" />
|
|
|
+ <result column="subordinate_amount" jdbcType="DECIMAL" property="subordinateAmount" />
|
|
|
+ <result column="total_amount" jdbcType="DECIMAL" property="totalAmount" />
|
|
|
+ <result column="retrial_finance_id" jdbcType="VARCHAR" property="retrialFinanceId" />
|
|
|
</resultMap>
|
|
|
<sql id="Base_Column_List">
|
|
|
id, create_id, create_time, update_time, deleted_sign, `name`, `type`, manager_id,
|
|
|
dep_no, super_id, remarks, `status`, abbreviation, finance_id, province, working_hours_type,
|
|
|
- hide_sign, lvl
|
|
|
+ hide_sign, lvl, current_amount, subordinate_amount, total_amount, retrial_finance_id
|
|
|
</sql>
|
|
|
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
|
|
|
select
|
|
|
@@ -36,28 +40,27 @@
|
|
|
delete from department
|
|
|
where id = #{id,jdbcType=VARCHAR}
|
|
|
</delete>
|
|
|
- <insert id="insert" parameterType="com.goafanti.common.model.Department">
|
|
|
- insert into department (id, create_id, create_time,
|
|
|
- update_time, deleted_sign, `name`,
|
|
|
- `type`, manager_id, dep_no,
|
|
|
- super_id, remarks, `status`,
|
|
|
- abbreviation, finance_id, province,
|
|
|
- working_hours_type, hide_sign, lvl
|
|
|
+ <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.Department" useGeneratedKeys="true">
|
|
|
+ insert into department (create_id, create_time, update_time,
|
|
|
+ deleted_sign, `name`, `type`,
|
|
|
+ manager_id, dep_no, super_id,
|
|
|
+ remarks, `status`, abbreviation,
|
|
|
+ finance_id, province, working_hours_type,
|
|
|
+ hide_sign, lvl, current_amount,
|
|
|
+ subordinate_amount, total_amount, retrial_finance_id
|
|
|
)
|
|
|
- values (#{id,jdbcType=VARCHAR}, #{createId,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
|
|
|
- #{updateTime,jdbcType=TIMESTAMP}, #{deletedSign,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR},
|
|
|
- #{type,jdbcType=VARCHAR}, #{managerId,jdbcType=VARCHAR}, #{depNo,jdbcType=VARCHAR},
|
|
|
- #{superId,jdbcType=VARCHAR}, #{remarks,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR},
|
|
|
- #{abbreviation,jdbcType=VARCHAR}, #{financeId,jdbcType=VARCHAR}, #{province,jdbcType=INTEGER},
|
|
|
- #{workingHoursType,jdbcType=INTEGER}, #{hideSign,jdbcType=INTEGER}, #{lvl,jdbcType=INTEGER}
|
|
|
+ values (#{createId,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP},
|
|
|
+ #{deletedSign,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR},
|
|
|
+ #{managerId,jdbcType=VARCHAR}, #{depNo,jdbcType=VARCHAR}, #{superId,jdbcType=VARCHAR},
|
|
|
+ #{remarks,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, #{abbreviation,jdbcType=VARCHAR},
|
|
|
+ #{financeId,jdbcType=VARCHAR}, #{province,jdbcType=INTEGER}, #{workingHoursType,jdbcType=INTEGER},
|
|
|
+ #{hideSign,jdbcType=INTEGER}, #{lvl,jdbcType=INTEGER}, #{currentAmount,jdbcType=DECIMAL},
|
|
|
+ #{subordinateAmount,jdbcType=DECIMAL}, #{totalAmount,jdbcType=DECIMAL}, #{retrialFinanceId,jdbcType=VARCHAR}
|
|
|
)
|
|
|
</insert>
|
|
|
- <insert id="insertSelective" parameterType="com.goafanti.common.model.Department">
|
|
|
+ <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.Department" useGeneratedKeys="true">
|
|
|
insert into department
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
- <if test="id != null">
|
|
|
- id,
|
|
|
- </if>
|
|
|
<if test="createId != null">
|
|
|
create_id,
|
|
|
</if>
|
|
|
@@ -109,11 +112,20 @@
|
|
|
<if test="lvl != null">
|
|
|
lvl,
|
|
|
</if>
|
|
|
+ <if test="currentAmount != null">
|
|
|
+ current_amount,
|
|
|
+ </if>
|
|
|
+ <if test="subordinateAmount != null">
|
|
|
+ subordinate_amount,
|
|
|
+ </if>
|
|
|
+ <if test="totalAmount != null">
|
|
|
+ total_amount,
|
|
|
+ </if>
|
|
|
+ <if test="retrialFinanceId != null">
|
|
|
+ retrial_finance_id,
|
|
|
+ </if>
|
|
|
</trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
- <if test="id != null">
|
|
|
- #{id,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
<if test="createId != null">
|
|
|
#{createId,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
@@ -165,6 +177,18 @@
|
|
|
<if test="lvl != null">
|
|
|
#{lvl,jdbcType=INTEGER},
|
|
|
</if>
|
|
|
+ <if test="currentAmount != null">
|
|
|
+ #{currentAmount,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
+ <if test="subordinateAmount != null">
|
|
|
+ #{subordinateAmount,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
+ <if test="totalAmount != null">
|
|
|
+ #{totalAmount,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
+ <if test="retrialFinanceId != null">
|
|
|
+ #{retrialFinanceId,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
</trim>
|
|
|
</insert>
|
|
|
<update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.Department">
|
|
|
@@ -221,6 +245,18 @@
|
|
|
<if test="lvl != null">
|
|
|
lvl = #{lvl,jdbcType=INTEGER},
|
|
|
</if>
|
|
|
+ <if test="currentAmount != null">
|
|
|
+ current_amount = #{currentAmount,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
+ <if test="subordinateAmount != null">
|
|
|
+ subordinate_amount = #{subordinateAmount,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
+ <if test="totalAmount != null">
|
|
|
+ total_amount = #{totalAmount,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
+ <if test="retrialFinanceId != null">
|
|
|
+ retrial_finance_id = #{retrialFinanceId,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
</set>
|
|
|
where id = #{id,jdbcType=VARCHAR}
|
|
|
</update>
|
|
|
@@ -242,11 +278,19 @@
|
|
|
province = #{province,jdbcType=INTEGER},
|
|
|
working_hours_type = #{workingHoursType,jdbcType=INTEGER},
|
|
|
hide_sign = #{hideSign,jdbcType=INTEGER},
|
|
|
- lvl = #{lvl,jdbcType=INTEGER}
|
|
|
+ lvl = #{lvl,jdbcType=INTEGER},
|
|
|
+ current_amount = #{currentAmount,jdbcType=DECIMAL},
|
|
|
+ subordinate_amount = #{subordinateAmount,jdbcType=DECIMAL},
|
|
|
+ total_amount = #{totalAmount,jdbcType=DECIMAL},
|
|
|
+ retrial_finance_id = #{retrialFinanceId,jdbcType=VARCHAR}
|
|
|
where id = #{id,jdbcType=VARCHAR}
|
|
|
</update>
|
|
|
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
<select id="selectOrganizationList" parameterType="String" resultType="com.goafanti.organization.bo.OrganizationListOut">
|
|
|
select
|
|
|
om.id,om.create_id as createId,om.create_time as createTime,
|
|
|
@@ -306,11 +350,11 @@
|
|
|
from department
|
|
|
where status ='0'
|
|
|
<if test="lvl != null ">
|
|
|
- and lvl= #{lvl}
|
|
|
+ and lvl= #{lvl}
|
|
|
+ </if>
|
|
|
+ <if test="hideSign != null ">
|
|
|
+ and hide_sign= #{hideSign}
|
|
|
</if>
|
|
|
- <if test="hideSign != null ">
|
|
|
- and hide_sign= #{hideSign}
|
|
|
- </if>
|
|
|
<if test="id != null ">
|
|
|
and super_id= #{id}
|
|
|
</if>
|
|
|
@@ -362,9 +406,10 @@
|
|
|
select a.id, a.create_id as createId, a.create_time as createTime, a.update_time as updateTime,
|
|
|
a.deleted_sign as deletedSign, a.name, a.type, a.manager_id as managerId, a.dep_no as depNo,
|
|
|
a.super_id as superId, a.remarks, a.status, a.abbreviation, a.finance_id financeId,a.hide_sign hideSign,
|
|
|
- a.province, c.name financeName, a.working_hours_type workingHoursType, b.name as managerName
|
|
|
- from department a
|
|
|
- left join admin b on a.manager_id = b.id left join admin c on a.finance_id = c.id
|
|
|
+ a.province, c.name financeName, a.working_hours_type workingHoursType, b.name as managerName,
|
|
|
+ a.retrial_finance_id retrialFinanceId, d.name retrialFinanceName
|
|
|
+ from department a left join admin b on a.manager_id = b.id left join admin c on a.finance_id = c.id
|
|
|
+ left join admin d on a.retrial_finance_id=d.id
|
|
|
where a.id=#{id,jdbcType=VARCHAR}
|
|
|
</select>
|
|
|
<delete id="deleteById" parameterType="java.lang.String">
|
|
|
@@ -402,13 +447,13 @@
|
|
|
update department
|
|
|
<set>
|
|
|
dep_no = #{depNo,jdbcType=VARCHAR},
|
|
|
- lvl= #{lvl}
|
|
|
+ lvl= #{lvl}
|
|
|
</set>
|
|
|
where
|
|
|
id=#{id,jdbcType=VARCHAR}
|
|
|
</update>
|
|
|
|
|
|
- <select id="selectCountBySuperId" parameterType="String" resultType="java.lang.Integer">
|
|
|
+ <select id="selectCountBySuperId" parameterType="String" resultType="java.lang.Integer">
|
|
|
select
|
|
|
count(0)
|
|
|
from department
|