| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320 |
- <?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.goafanti.common.dao.ExpenseAccountDetailsMapper">
- <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="start_district" jdbcType="VARCHAR" property="startDistrict" />
- <result column="end_district" jdbcType="VARCHAR" property="endDistrict" />
- <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="agree_time" jdbcType="TIMESTAMP" property="agreeTime" />
- <result column="pay_type" jdbcType="INTEGER" property="payType" />
- <result column="invoice_type" jdbcType="INTEGER" property="invoiceType" />
- <result column="invoice_no" jdbcType="VARCHAR" property="invoiceNo" />
- <result column="payer_name" jdbcType="VARCHAR" property="payerName" />
- <result column="open_bank" jdbcType="VARCHAR" property="openBank" />
- <result column="bank_accounts" jdbcType="VARCHAR" property="bankAccounts" />
- <result column="open_bank_address" jdbcType="VARCHAR" property="openBankAddress" />
- <result column="lend_id" jdbcType="INTEGER" property="lendId" />
- <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
- <result column="real_amount" jdbcType="DECIMAL" property="realAmount" />
- <result column="type_other" jdbcType="VARCHAR" property="typeOther" />
- </resultMap>
- <sql id="Base_Column_List">
- id, eaid, `type`, start_time, end_time, start_district, end_district, amount, vehicle,
- vehicle_other, remarks, agree_time, pay_type, invoice_type, invoice_no, payer_name,
- open_bank, bank_accounts, open_bank_address, lend_id, create_time, real_amount, type_other
- </sql>
- <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
- select
- <include refid="Base_Column_List" />
- from expense_account_details
- where id = #{id,jdbcType=INTEGER}
- </select>
- <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, `type`, start_time,
- end_time, start_district, end_district,
- amount, vehicle, vehicle_other,
- remarks, agree_time, pay_type,
- invoice_type, invoice_no, payer_name,
- open_bank, bank_accounts, open_bank_address,
- lend_id, create_time, real_amount,
- type_other)
- values (#{eaid,jdbcType=INTEGER}, #{type,jdbcType=INTEGER}, #{startTime,jdbcType=TIMESTAMP},
- #{endTime,jdbcType=TIMESTAMP}, #{startDistrict,jdbcType=VARCHAR}, #{endDistrict,jdbcType=VARCHAR},
- #{amount,jdbcType=DECIMAL}, #{vehicle,jdbcType=INTEGER}, #{vehicleOther,jdbcType=VARCHAR},
- #{remarks,jdbcType=VARCHAR}, #{agreeTime,jdbcType=TIMESTAMP}, #{payType,jdbcType=INTEGER},
- #{invoiceType,jdbcType=INTEGER}, #{invoiceNo,jdbcType=VARCHAR}, #{payerName,jdbcType=VARCHAR},
- #{openBank,jdbcType=VARCHAR}, #{bankAccounts,jdbcType=VARCHAR}, #{openBankAddress,jdbcType=VARCHAR},
- #{lendId,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{realAmount,jdbcType=DECIMAL},
- #{typeOther,jdbcType=VARCHAR})
- </insert>
- <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.ExpenseAccountDetails" useGeneratedKeys="true">
- insert into expense_account_details
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="eaid != null">
- eaid,
- </if>
- <if test="type != null">
- `type`,
- </if>
- <if test="startTime != null">
- start_time,
- </if>
- <if test="endTime != null">
- end_time,
- </if>
- <if test="startDistrict != null">
- start_district,
- </if>
- <if test="endDistrict != null">
- end_district,
- </if>
- <if test="amount != null">
- amount,
- </if>
- <if test="vehicle != null">
- vehicle,
- </if>
- <if test="vehicleOther != null">
- vehicle_other,
- </if>
- <if test="remarks != null">
- remarks,
- </if>
- <if test="agreeTime != null">
- agree_time,
- </if>
- <if test="payType != null">
- pay_type,
- </if>
- <if test="invoiceType != null">
- invoice_type,
- </if>
- <if test="invoiceNo != null">
- invoice_no,
- </if>
- <if test="payerName != null">
- payer_name,
- </if>
- <if test="openBank != null">
- open_bank,
- </if>
- <if test="bankAccounts != null">
- bank_accounts,
- </if>
- <if test="openBankAddress != null">
- open_bank_address,
- </if>
- <if test="lendId != null">
- lend_id,
- </if>
- <if test="createTime != null">
- create_time,
- </if>
- <if test="realAmount != null">
- real_amount,
- </if>
- <if test="typeOther != null">
- type_other,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="eaid != null">
- #{eaid,jdbcType=INTEGER},
- </if>
- <if test="type != null">
- #{type,jdbcType=INTEGER},
- </if>
- <if test="startTime != null">
- #{startTime,jdbcType=TIMESTAMP},
- </if>
- <if test="endTime != null">
- #{endTime,jdbcType=TIMESTAMP},
- </if>
- <if test="startDistrict != null">
- #{startDistrict,jdbcType=VARCHAR},
- </if>
- <if test="endDistrict != null">
- #{endDistrict,jdbcType=VARCHAR},
- </if>
- <if test="amount != null">
- #{amount,jdbcType=DECIMAL},
- </if>
- <if test="vehicle != null">
- #{vehicle,jdbcType=INTEGER},
- </if>
- <if test="vehicleOther != null">
- #{vehicleOther,jdbcType=VARCHAR},
- </if>
- <if test="remarks != null">
- #{remarks,jdbcType=VARCHAR},
- </if>
- <if test="agreeTime != null">
- #{agreeTime,jdbcType=TIMESTAMP},
- </if>
- <if test="payType != null">
- #{payType,jdbcType=INTEGER},
- </if>
- <if test="invoiceType != null">
- #{invoiceType,jdbcType=INTEGER},
- </if>
- <if test="invoiceNo != null">
- #{invoiceNo,jdbcType=VARCHAR},
- </if>
- <if test="payerName != null">
- #{payerName,jdbcType=VARCHAR},
- </if>
- <if test="openBank != null">
- #{openBank,jdbcType=VARCHAR},
- </if>
- <if test="bankAccounts != null">
- #{bankAccounts,jdbcType=VARCHAR},
- </if>
- <if test="openBankAddress != null">
- #{openBankAddress,jdbcType=VARCHAR},
- </if>
- <if test="lendId != null">
- #{lendId,jdbcType=INTEGER},
- </if>
- <if test="createTime != null">
- #{createTime,jdbcType=TIMESTAMP},
- </if>
- <if test="realAmount != null">
- #{realAmount,jdbcType=DECIMAL},
- </if>
- <if test="typeOther != null">
- #{typeOther,jdbcType=VARCHAR},
- </if>
- </trim>
- </insert>
- <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.ExpenseAccountDetails">
- update expense_account_details
- <set>
- <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>
- <if test="endTime != null">
- end_time = #{endTime,jdbcType=TIMESTAMP},
- </if>
- <if test="startDistrict != null">
- start_district = #{startDistrict,jdbcType=VARCHAR},
- </if>
- <if test="endDistrict != null">
- end_district = #{endDistrict,jdbcType=VARCHAR},
- </if>
- <if test="amount != null">
- amount = #{amount,jdbcType=DECIMAL},
- </if>
- <if test="vehicle != null">
- vehicle = #{vehicle,jdbcType=INTEGER},
- </if>
- <if test="vehicleOther != null">
- vehicle_other = #{vehicleOther,jdbcType=VARCHAR},
- </if>
- <if test="remarks != null">
- remarks = #{remarks,jdbcType=VARCHAR},
- </if>
- <if test="agreeTime != null">
- agree_time = #{agreeTime,jdbcType=TIMESTAMP},
- </if>
- <if test="payType != null">
- pay_type = #{payType,jdbcType=INTEGER},
- </if>
- <if test="invoiceType != null">
- invoice_type = #{invoiceType,jdbcType=INTEGER},
- </if>
- <if test="invoiceNo != null">
- invoice_no = #{invoiceNo,jdbcType=VARCHAR},
- </if>
- <if test="payerName != null">
- payer_name = #{payerName,jdbcType=VARCHAR},
- </if>
- <if test="openBank != null">
- open_bank = #{openBank,jdbcType=VARCHAR},
- </if>
- <if test="bankAccounts != null">
- bank_accounts = #{bankAccounts,jdbcType=VARCHAR},
- </if>
- <if test="openBankAddress != null">
- open_bank_address = #{openBankAddress,jdbcType=VARCHAR},
- </if>
- <if test="lendId != null">
- lend_id = #{lendId,jdbcType=INTEGER},
- </if>
- <if test="createTime != null">
- create_time = #{createTime,jdbcType=TIMESTAMP},
- </if>
- <if test="realAmount != null">
- real_amount = #{realAmount,jdbcType=DECIMAL},
- </if>
- <if test="typeOther != null">
- type_other = #{typeOther,jdbcType=VARCHAR},
- </if>
- </set>
- where id = #{id,jdbcType=INTEGER}
- </update>
- <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},
- start_district = #{startDistrict,jdbcType=VARCHAR},
- end_district = #{endDistrict,jdbcType=VARCHAR},
- amount = #{amount,jdbcType=DECIMAL},
- vehicle = #{vehicle,jdbcType=INTEGER},
- vehicle_other = #{vehicleOther,jdbcType=VARCHAR},
- remarks = #{remarks,jdbcType=VARCHAR},
- agree_time = #{agreeTime,jdbcType=TIMESTAMP},
- pay_type = #{payType,jdbcType=INTEGER},
- invoice_type = #{invoiceType,jdbcType=INTEGER},
- invoice_no = #{invoiceNo,jdbcType=VARCHAR},
- payer_name = #{payerName,jdbcType=VARCHAR},
- open_bank = #{openBank,jdbcType=VARCHAR},
- bank_accounts = #{bankAccounts,jdbcType=VARCHAR},
- open_bank_address = #{openBankAddress,jdbcType=VARCHAR},
- lend_id = #{lendId,jdbcType=INTEGER},
- create_time = #{createTime,jdbcType=TIMESTAMP},
- real_amount = #{realAmount,jdbcType=DECIMAL},
- type_other = #{typeOther,jdbcType=VARCHAR}
- where id = #{id,jdbcType=INTEGER}
- </update>
- <select id="selectByEAid" resultType="com.goafanti.expenseAccount.bo.OutExpenseAccountDetails">
- SELECT id, eaid, `type`, type_other typeOther, date_format(a.start_time,'%Y-%m-%d %H:%i:%S')startTimeStr, date_format(a.end_time,'%Y-%m-%d %H:%i:%S')endTimeStr,
- start_district startDistrict, end_district endDistrict, amount,real_Amount realAmount, vehicle, vehicle_other vehicleOther, remarks,
- date_format(a.agree_time,'%Y-%m-%d %H:%i:%S')agreeTimeStr, pay_type payType,invoice_type invoiceType, invoice_no invoiceNo,
- payer_name payerName, open_bank openBank, bank_accounts bankAccounts, open_bank_address openBankAddress, lend_id lendId,
- date_format(a.create_time,'%Y-%m-%d %H:%i:%S')createTimeStr
- FROM expense_account_details a WHERE eaid= #{eaid}
- </select>
- <delete id="deleteByeaid">
- delete from expense_account_details
- where eaid = #{id}
- </delete>
- <select id="selectExpenseAccountById" resultType="java.lang.Integer">
- select b.id
- from expense_account_details a left join expense_relationship b on a.eaid =b.ea_id
- where a.id= #{id}
- </select>
- </mapper>
|