|
|
@@ -4,15 +4,18 @@
|
|
|
<resultMap id="BaseResultMap" type="com.goafanti.common.model.ExpenseAccountDetails">
|
|
|
<id column="id" jdbcType="INTEGER" property="id" />
|
|
|
<result column="eaid" jdbcType="INTEGER" property="eaid" />
|
|
|
+ <result column="type" jdbcType="INTEGER" property="type" />
|
|
|
<result column="start_time" jdbcType="TIMESTAMP" property="startTime" />
|
|
|
<result column="end_time" jdbcType="TIMESTAMP" property="endTime" />
|
|
|
<result column="amount" jdbcType="DECIMAL" property="amount" />
|
|
|
<result column="vehicle" jdbcType="INTEGER" property="vehicle" />
|
|
|
<result column="vehicle_other" jdbcType="VARCHAR" property="vehicleOther" />
|
|
|
+ <result column="remarks" jdbcType="VARCHAR" property="remarks" />
|
|
|
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
|
|
</resultMap>
|
|
|
<sql id="Base_Column_List">
|
|
|
- id, eaid, start_time, end_time, amount, vehicle, vehicle_other, create_time
|
|
|
+ id, eaid, `type`, start_time, end_time, amount, vehicle, vehicle_other, remarks,
|
|
|
+ create_time
|
|
|
</sql>
|
|
|
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
|
|
select
|
|
|
@@ -20,18 +23,19 @@
|
|
|
from expense_account_details
|
|
|
where id = #{id,jdbcType=INTEGER}
|
|
|
</select>
|
|
|
-
|
|
|
- <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
|
|
+ <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
|
|
delete from expense_account_details
|
|
|
where id = #{id,jdbcType=INTEGER}
|
|
|
</delete>
|
|
|
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.ExpenseAccountDetails" useGeneratedKeys="true">
|
|
|
- insert into expense_account_details (eaid, start_time, end_time,
|
|
|
- amount, vehicle, vehicle_other,
|
|
|
- create_time)
|
|
|
- values (#{eaid,jdbcType=INTEGER}, #{startTime,jdbcType=TIMESTAMP}, #{endTime,jdbcType=TIMESTAMP},
|
|
|
- #{amount,jdbcType=DECIMAL}, #{vehicle,jdbcType=INTEGER}, #{vehicleOther,jdbcType=VARCHAR},
|
|
|
- #{createTime,jdbcType=TIMESTAMP})
|
|
|
+ insert into expense_account_details (eaid, `type`, start_time,
|
|
|
+ end_time, amount, vehicle,
|
|
|
+ vehicle_other, remarks, create_time
|
|
|
+ )
|
|
|
+ values (#{eaid,jdbcType=INTEGER}, #{type,jdbcType=INTEGER}, #{startTime,jdbcType=TIMESTAMP},
|
|
|
+ #{endTime,jdbcType=TIMESTAMP}, #{amount,jdbcType=DECIMAL}, #{vehicle,jdbcType=INTEGER},
|
|
|
+ #{vehicleOther,jdbcType=VARCHAR}, #{remarks,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}
|
|
|
+ )
|
|
|
</insert>
|
|
|
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.ExpenseAccountDetails" useGeneratedKeys="true">
|
|
|
insert into expense_account_details
|
|
|
@@ -39,6 +43,9 @@
|
|
|
<if test="eaid != null">
|
|
|
eaid,
|
|
|
</if>
|
|
|
+ <if test="type != null">
|
|
|
+ `type`,
|
|
|
+ </if>
|
|
|
<if test="startTime != null">
|
|
|
start_time,
|
|
|
</if>
|
|
|
@@ -54,6 +61,9 @@
|
|
|
<if test="vehicleOther != null">
|
|
|
vehicle_other,
|
|
|
</if>
|
|
|
+ <if test="remarks != null">
|
|
|
+ remarks,
|
|
|
+ </if>
|
|
|
<if test="createTime != null">
|
|
|
create_time,
|
|
|
</if>
|
|
|
@@ -62,6 +72,9 @@
|
|
|
<if test="eaid != null">
|
|
|
#{eaid,jdbcType=INTEGER},
|
|
|
</if>
|
|
|
+ <if test="type != null">
|
|
|
+ #{type,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
<if test="startTime != null">
|
|
|
#{startTime,jdbcType=TIMESTAMP},
|
|
|
</if>
|
|
|
@@ -77,6 +90,9 @@
|
|
|
<if test="vehicleOther != null">
|
|
|
#{vehicleOther,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
+ <if test="remarks != null">
|
|
|
+ #{remarks,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
<if test="createTime != null">
|
|
|
#{createTime,jdbcType=TIMESTAMP},
|
|
|
</if>
|
|
|
@@ -88,6 +104,9 @@
|
|
|
<if test="eaid != null">
|
|
|
eaid = #{eaid,jdbcType=INTEGER},
|
|
|
</if>
|
|
|
+ <if test="type != null">
|
|
|
+ `type` = #{type,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
<if test="startTime != null">
|
|
|
start_time = #{startTime,jdbcType=TIMESTAMP},
|
|
|
</if>
|
|
|
@@ -103,6 +122,9 @@
|
|
|
<if test="vehicleOther != null">
|
|
|
vehicle_other = #{vehicleOther,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
+ <if test="remarks != null">
|
|
|
+ remarks = #{remarks,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
<if test="createTime != null">
|
|
|
create_time = #{createTime,jdbcType=TIMESTAMP},
|
|
|
</if>
|
|
|
@@ -112,14 +134,18 @@
|
|
|
<update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.ExpenseAccountDetails">
|
|
|
update expense_account_details
|
|
|
set eaid = #{eaid,jdbcType=INTEGER},
|
|
|
+ `type` = #{type,jdbcType=INTEGER},
|
|
|
start_time = #{startTime,jdbcType=TIMESTAMP},
|
|
|
end_time = #{endTime,jdbcType=TIMESTAMP},
|
|
|
amount = #{amount,jdbcType=DECIMAL},
|
|
|
vehicle = #{vehicle,jdbcType=INTEGER},
|
|
|
vehicle_other = #{vehicleOther,jdbcType=VARCHAR},
|
|
|
+ remarks = #{remarks,jdbcType=VARCHAR},
|
|
|
create_time = #{createTime,jdbcType=TIMESTAMP}
|
|
|
where id = #{id,jdbcType=INTEGER}
|
|
|
</update>
|
|
|
+
|
|
|
+
|
|
|
<select id="selectAmountCountByEAid" resultType="java.math.BigDecimal">
|
|
|
select ifnull(sum(amount),0)amount from expense_account_details
|
|
|
where eaid = #{id}
|