fix: 修改包名,模块名。
This commit is contained in:
@@ -0,0 +1,208 @@
|
||||
<?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.intc.invest.mapper.AccountsDealRecordMapper">
|
||||
|
||||
<resultMap type="AccountsDealRecordVo" id="AccountsDealRecordResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="name" column="name" />
|
||||
<result property="type" column="type" />
|
||||
<result property="accountId" column="account_id" />
|
||||
<result property="amount" column="amount" />
|
||||
<result property="dealType" column="deal_type" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="dealCategory" column="deal_category" />
|
||||
<result property="accountName" column="account_name" />
|
||||
<result property="transferRecordId" column="transfer_record_id" />
|
||||
<result property="currentBalance" column="current_balance" />
|
||||
<result property="childCategory" column="child_category" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectAccountsDealRecordVo">
|
||||
select
|
||||
a.id,
|
||||
a.name,
|
||||
a.type,
|
||||
a.account_id,
|
||||
a.amount,
|
||||
a.transfer_record_id,
|
||||
a.deal_type,
|
||||
a.create_by,
|
||||
a.create_time,
|
||||
a.update_by,
|
||||
a.update_time,
|
||||
a.del_flag,
|
||||
a.remark,
|
||||
a.deal_category,
|
||||
a.current_balance,
|
||||
a.child_category,
|
||||
CONCAT(a2."name", '(', right(a2.code, 4), ')') as account_name
|
||||
from
|
||||
accounts_deal_record a
|
||||
left join accounts a2 on a2.id =a.account_id
|
||||
|
||||
</sql>
|
||||
|
||||
<select id="selectAccountsDealRecordList" parameterType="AccountsDealRecordDto" resultMap="AccountsDealRecordResult">
|
||||
<include refid="selectAccountsDealRecordVo"/>
|
||||
<where>
|
||||
a.del_flag='0'
|
||||
<if test="name != null and name != ''"> and (a2."name" like '%'|| #{name}||'%' or a2."code" like '%'|| #{name}||'%')</if>
|
||||
<if test="type != null and type != ''"> and a.type = #{type}</if>
|
||||
<if test="transferRecordId != null and transferRecordId != ''"> and a.transfer_record_id = #{transferRecordId}</if>
|
||||
<if test="accountId != null and accountId != ''"> and a.account_id = #{accountId}</if>
|
||||
<if test="dealType != null and dealType != ''"> and a.deal_type = #{dealType}</if>
|
||||
<if test="dealCategory != null and dealCategory != ''"> and a.deal_category = #{dealCategory}</if>
|
||||
<if test="childCategory != null and childCategory != ''"> and a.child_category = #{childCategory}</if>
|
||||
<if test="endTime!=null and endTime !=''">
|
||||
and #{endTime}>=to_char(a.create_time, 'yyyy-MM-dd')
|
||||
</if>
|
||||
<if test="startTime!=null and startTime !=''">
|
||||
and to_char(a.create_time, 'yyyy-MM-dd')>=#{startTime}
|
||||
</if>
|
||||
<if test="endDateTime!=null">
|
||||
and #{endDateTime}>=a.create_time
|
||||
</if>
|
||||
<if test="startDateTime!=null">
|
||||
and a.create_time>=#{startDateTime}
|
||||
</if>
|
||||
<if test="creditBill!=null">
|
||||
and a.deal_category!=#{creditBill}
|
||||
</if>
|
||||
|
||||
</where>
|
||||
<!-- 数据范围过滤 -->
|
||||
${params.dataScope}
|
||||
order by a.create_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectAccountsDealRecordById" parameterType="Long" resultMap="AccountsDealRecordResult">
|
||||
<include refid="selectAccountsDealRecordVo"/>
|
||||
where a.id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertAccountsDealRecord" parameterType="AccountsDealRecord">
|
||||
insert into accounts_deal_record
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</if>
|
||||
<if test="name != null and name != ''">name,</if>
|
||||
<if test="type != null and type != ''">type,</if>
|
||||
<if test="accountId != null and accountId != ''">account_id,</if>
|
||||
<if test="amount != null">amount,</if>
|
||||
<if test="dealType != null and dealType != ''">deal_type,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="dealCategory != null and dealCategory != ''">deal_category,</if>
|
||||
<if test="transferRecordId != null and transferRecordId != ''">transfer_record_id,</if>
|
||||
<if test="currentBalance != null">current_balance,</if>
|
||||
<if test="childCategory != null">child_category,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
<if test="name != null and name != ''">#{name},</if>
|
||||
<if test="type != null and type != ''">#{type},</if>
|
||||
<if test="accountId != null and accountId != ''">#{accountId},</if>
|
||||
<if test="amount != null">#{amount},</if>
|
||||
<if test="dealType != null and dealType != ''">#{dealType},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="dealCategory != null and dealCategory != ''">#{dealCategory},</if>
|
||||
<if test="transferRecordId != null and transferRecordId != ''">#{transferRecordId},</if>
|
||||
<if test="currentBalance != null">#{currentBalance},</if>
|
||||
<if test="childCategory != null">#{childCategory},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateAccountsDealRecord" parameterType="AccountsDealRecord">
|
||||
update accounts_deal_record
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="name != null and name != ''">name = #{name},</if>
|
||||
<if test="type != null and type != ''">type = #{type},</if>
|
||||
<if test="accountId != null and accountId != ''">account_id = #{accountId},</if>
|
||||
<if test="amount != null">amount = #{amount},</if>
|
||||
<if test="dealType != null and dealType != ''">deal_type = #{dealType},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="dealCategory != null and dealCategory != ''">deal_category = #{dealCategory},</if>
|
||||
<if test="transferRecordId != null and transferRecordId != ''">transfer_record_id = #{transferRecordId},</if>
|
||||
<if test="currentBalance != null ">current_balance = #{currentBalance},</if>
|
||||
<if test="childCategory != null ">child_category = #{childCategory},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteAccountsDealRecordById" parameterType="Long">
|
||||
delete from accounts_deal_record where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteAccountsDealRecordByTransferId" parameterType="Long">
|
||||
delete from accounts_deal_record where transfer_record_id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteAccountsDealRecordByIds" parameterType="String">
|
||||
delete from accounts_deal_record where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
<update id="removeAccountsDealRecordById" parameterType="Long">
|
||||
update accounts_deal_record set del_flag='1' where id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="removeAccountsDealRecordByIds" parameterType="String">
|
||||
update accounts_deal_record set del_flag='1' where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</update>
|
||||
<update id="batchPlusCurrentBalance" >
|
||||
update accounts_deal_record
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="currentBalance != null ">current_balance = current_balance+#{currentBalance},</if>
|
||||
</trim>
|
||||
where account_id = #{accountId}
|
||||
<if test="startDateTime!=null">
|
||||
and create_time>=#{startDateTime}
|
||||
</if>
|
||||
</update>
|
||||
|
||||
<update id="batchMinusCurrentBalance" >
|
||||
update accounts_deal_record
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="currentBalance != null ">current_balance = current_balance-#{currentBalance},</if>
|
||||
</trim>
|
||||
where account_id = #{accountId}
|
||||
<if test="startDateTime!=null">
|
||||
and create_time>=#{startDateTime}
|
||||
</if>
|
||||
</update>
|
||||
|
||||
<select id="getLastOneAccountsDealRecordByMap" resultMap="AccountsDealRecordResult">
|
||||
<include refid="selectAccountsDealRecordVo"/>
|
||||
where a.account_id = #{accountId}
|
||||
and a.del_flag='0'
|
||||
<if test="startDateTime!=null">
|
||||
and #{startDateTime}>=a.create_time
|
||||
</if>
|
||||
order by a.create_time desc
|
||||
limit 1
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,165 @@
|
||||
<?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.intc.invest.mapper.AccountsMapper">
|
||||
|
||||
<resultMap type="AccountsVo" id="AccountsResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="name" column="name" />
|
||||
<result property="type" column="type" />
|
||||
<result property="code" column="code" />
|
||||
<result property="balance" column="balance" />
|
||||
<result property="creditLimit" column="credit_limit" />
|
||||
<result property="availableLimit" column="available_limit" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="accountId" column="account_id" />
|
||||
<result property="state" column="state" />
|
||||
<result property="billDate" column="bill_date" />
|
||||
<result property="payDate" column="pay_date" />
|
||||
<result property="creditLimit" column="credit_limit" />
|
||||
<result property="debitType" column="debit_type" />
|
||||
<result property="lendType" column="lend_type" />
|
||||
<result property="status" column="status" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectAccountsVo">
|
||||
select
|
||||
a.id,
|
||||
a.name,
|
||||
a.type,
|
||||
a.code,
|
||||
a.balance,
|
||||
a.credit_limit,
|
||||
a.available_limit,
|
||||
a.create_by,
|
||||
a.create_time,
|
||||
a.update_by,
|
||||
a.update_time,
|
||||
a.del_flag,
|
||||
a.remark,
|
||||
a.account_id,
|
||||
a.state,
|
||||
a.status,
|
||||
bcl.bill_date ,
|
||||
bcl.pay_date ,
|
||||
bcl.credit_limit ,
|
||||
bcl.debit_type,
|
||||
bcl.lend_type
|
||||
from
|
||||
accounts a
|
||||
left join bank_card_lend bcl on
|
||||
bcl.id = a.id
|
||||
</sql>
|
||||
|
||||
<select id="selectAccountsList" parameterType="AccountsDto" resultMap="AccountsResult">
|
||||
<include refid="selectAccountsVo"/>
|
||||
<where>
|
||||
a.del_flag='0'
|
||||
<if test="name != null and name != ''"> and a.name like '%'|| #{name}||'%'</if>
|
||||
<if test="type != null and type != ''"> and a.type = #{type}</if>
|
||||
<if test="debitType != null and debitType != ''"> and bcl.debit_type = #{debitType}</if>
|
||||
<if test="lendType != null and lendType != ''"> and bcl.lend_type = #{lendType}</if>
|
||||
<if test="state != null and state != ''"> and a.state = #{state}</if>
|
||||
<if test="status != null and status != ''"> and a.status = #{status}</if>
|
||||
<if test="accountId != null and accountId != ''"> and a.account_id = #{accountId}</if>
|
||||
<if test="repayFlag != null and repayFlag != ''"> and bcl.debit_type in('1','2')</if>
|
||||
</where>
|
||||
<!-- 数据范围过滤 -->
|
||||
${params.dataScope}
|
||||
order by a.type asc,bcl.debit_type asc,a.update_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectAccountsById" parameterType="Long" resultMap="AccountsResult">
|
||||
<include refid="selectAccountsVo"/>
|
||||
where a.id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertAccounts" parameterType="Accounts">
|
||||
insert into accounts
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</if>
|
||||
<if test="name != null and name != ''">name,</if>
|
||||
<if test="type != null and type != ''">type,</if>
|
||||
<if test="code != null and code != ''">code,</if>
|
||||
<if test="balance != null">balance,</if>
|
||||
<if test="creditLimit != null">credit_limit,</if>
|
||||
<if test="availableLimit != null">available_limit,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="accountId != null and accountId != ''">account_id,</if>
|
||||
<if test="state != null">state,</if>
|
||||
<if test="status != null">status,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
<if test="name != null and name != ''">#{name},</if>
|
||||
<if test="type != null and type != ''">#{type},</if>
|
||||
<if test="code != null and code != ''">#{code},</if>
|
||||
<if test="balance != null">#{balance},</if>
|
||||
<if test="creditLimit != null">#{creditLimit},</if>
|
||||
<if test="availableLimit != null">#{availableLimit},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="accountId != null and accountId != ''">#{accountId},</if>
|
||||
<if test="state != null">#{state},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateAccounts" parameterType="Accounts">
|
||||
update accounts
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="name != null and name != ''">name = #{name},</if>
|
||||
<if test="type != null and type != ''">type = #{type},</if>
|
||||
<if test="code != null and code != ''">code = #{code},</if>
|
||||
<if test="balance != null">balance = #{balance},</if>
|
||||
<if test="creditLimit != null">credit_limit = #{creditLimit},</if>
|
||||
<if test="availableLimit != null">available_limit = #{availableLimit},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="accountId != null and accountId != ''">account_id = #{accountId},</if>
|
||||
<if test="state != null">state = #{state},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteAccountsById" parameterType="Long">
|
||||
delete from accounts where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteAccountsByIds" parameterType="String">
|
||||
delete from accounts where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
<update id="removeAccountsById" parameterType="Long">
|
||||
update accounts set del_flag='1' where id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="removeAccountsByIds" parameterType="String">
|
||||
update accounts set del_flag='1' where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</update>
|
||||
</mapper>
|
||||
@@ -0,0 +1,173 @@
|
||||
<?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.intc.invest.mapper.AccountsTransferRecordMapper">
|
||||
|
||||
<resultMap type="AccountsTransferRecordVo" id="AccountsTransferRecordResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="name" column="name" />
|
||||
<result property="type" column="type" />
|
||||
<result property="outAccountId" column="out_account_id" />
|
||||
<result property="inAccountId" column="in_account_id" />
|
||||
<result property="posId" column="pos_id" />
|
||||
<result property="commission" column="commission" />
|
||||
<result property="amount" column="amount" />
|
||||
<result property="actualAmount" column="actual_amount" />
|
||||
<result property="dealType" column="deal_type" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="posName" column="pos_name" />
|
||||
<result property="outAccountName" column="out_account_name" />
|
||||
<result property="inAccountName" column="in_account_name" />
|
||||
<result property="merchantName" column="merchant_name" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectAccountsTransferRecordVo">
|
||||
select
|
||||
a.id,
|
||||
a.name,
|
||||
a.type,
|
||||
a.out_account_id,
|
||||
a.in_account_id,
|
||||
a.pos_id,
|
||||
a.commission,
|
||||
a.amount,
|
||||
a.actual_amount,
|
||||
a.deal_type,
|
||||
a.create_by,
|
||||
a.create_time,
|
||||
a.update_by,
|
||||
a.update_time,
|
||||
a.del_flag,
|
||||
a.remark,
|
||||
pm."name" as pos_name,
|
||||
pm.merchant_name,
|
||||
CONCAT(a3."name", '(', right(a3.code, 4), ')') as out_account_name,
|
||||
CONCAT(a4."name", '(', right(a4.code, 4), ')') as in_account_name
|
||||
from
|
||||
accounts_transfer_record a
|
||||
left join pos_machine pm on
|
||||
pm.id = a.pos_id
|
||||
left join accounts a3 on
|
||||
a3.id = a.out_account_id
|
||||
left join accounts a4 on
|
||||
a4.id = a.in_account_id
|
||||
|
||||
</sql>
|
||||
|
||||
<select id="selectAccountsTransferRecordList" parameterType="AccountsTransferRecordDto" resultMap="AccountsTransferRecordResult">
|
||||
<include refid="selectAccountsTransferRecordVo"/>
|
||||
<where>
|
||||
a.del_flag='0'
|
||||
<if test="name != null and name != ''"> and a.name like '%'|| #{name}||'%'</if>
|
||||
<if test="type != null and type != ''"> and a.type = #{type}</if>
|
||||
<if test="inAccountId != null "> and a.in_account_id = #{inAccountId}</if>
|
||||
<if test="outAccountId != null "> and a.out_account_id = #{outAccountId}</if>
|
||||
<if test="accountId != null "> and (a.out_account_id = #{accountId} or a.in_account_id = #{accountId} or a.pos_id = #{accountId})</if>
|
||||
<if test="posId != null "> and a.pos_id = #{posId}</if>
|
||||
<if test="dealType != null and dealType != ''"> and a.deal_type = #{dealType}</if>
|
||||
<if test="endTime!=null and endTime !=''">
|
||||
and #{endTime}>=to_char(a.create_time, 'yyyy-MM-dd')
|
||||
</if>
|
||||
<if test="startTime!=null and startTime !=''">
|
||||
and to_char(a.create_time, 'yyyy-MM-dd')>=#{startTime}
|
||||
</if>
|
||||
</where>
|
||||
<!-- 数据范围过滤 -->
|
||||
${params.dataScope}
|
||||
order by a.create_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectAccountsTransferRecordById" parameterType="Long" resultMap="AccountsTransferRecordResult">
|
||||
<include refid="selectAccountsTransferRecordVo"/>
|
||||
where a.id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertAccountsTransferRecord" parameterType="AccountsTransferRecord">
|
||||
insert into accounts_transfer_record
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</if>
|
||||
<if test="name != null">name,</if>
|
||||
<if test="type != null">type,</if>
|
||||
<if test="outAccountId != null">out_account_id,</if>
|
||||
<if test="inAccountId != null">in_account_id,</if>
|
||||
<if test="posId != null">pos_id,</if>
|
||||
<if test="commission != null">commission,</if>
|
||||
<if test="amount != null">amount,</if>
|
||||
<if test="actualAmount != null">actual_amount,</if>
|
||||
<if test="dealType != null">deal_type,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
<if test="name != null">#{name},</if>
|
||||
<if test="type != null">#{type},</if>
|
||||
<if test="outAccountId != null">#{outAccountId},</if>
|
||||
<if test="inAccountId != null">#{inAccountId},</if>
|
||||
<if test="posId != null">#{posId},</if>
|
||||
<if test="commission != null">#{commission},</if>
|
||||
<if test="amount != null">#{amount},</if>
|
||||
<if test="actualAmount != null">#{actualAmount},</if>
|
||||
<if test="dealType != null">#{dealType},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateAccountsTransferRecord" parameterType="AccountsTransferRecord">
|
||||
update accounts_transfer_record
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="name != null">name = #{name},</if>
|
||||
<if test="type != null">type = #{type},</if>
|
||||
<if test="outAccountId != null">out_account_id = #{outAccountId},</if>
|
||||
<if test="inAccountId != null">in_account_id = #{inAccountId},</if>
|
||||
<if test="posId != null">pos_id = #{posId},</if>
|
||||
<if test="commission != null">commission = #{commission},</if>
|
||||
<if test="amount != null">amount = #{amount},</if>
|
||||
<if test="actualAmount != null">actual_amount = #{actualAmount},</if>
|
||||
<if test="dealType != null">deal_type = #{dealType},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteAccountsTransferRecordById" parameterType="Long">
|
||||
delete from accounts_transfer_record where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteAccountsTransferRecordByIds" parameterType="String">
|
||||
delete from accounts_transfer_record where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
<update id="removeAccountsTransferRecordById" parameterType="Long">
|
||||
update accounts_transfer_record set del_flag='1' where id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="removeAccountsTransferRecordByIds" parameterType="String">
|
||||
update accounts_transfer_record set del_flag='1' where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</update>
|
||||
</mapper>
|
||||
@@ -0,0 +1,197 @@
|
||||
<?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.intc.invest.mapper.BankCardLendMapper">
|
||||
|
||||
<resultMap type="BankCardLendVo" id="BankCardLendResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="name" column="name" />
|
||||
<result property="type" column="type" />
|
||||
<result property="code" column="code" />
|
||||
<result property="openingBank" column="opening_bank" />
|
||||
<result property="activationDate" column="activation_date" />
|
||||
<result property="billDate" column="bill_date" />
|
||||
<result property="payDate" column="pay_date" />
|
||||
<result property="delayPeriod" column="delay_period" />
|
||||
<result property="creditLimit" column="credit_limit" />
|
||||
<result property="effectiveDate" column="effective_date" />
|
||||
<result property="cvv" column="cvv" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="debitType" column="debit_type" />
|
||||
<result property="lendType" column="lend_type" />
|
||||
<result property="isNextBillDate" column="is_next_bill_date" />
|
||||
<result property="nextBillDateTime" column="next_bill_date_time" />
|
||||
<result property="isZeroBill" column="is_zero_bill" />
|
||||
<result property="balance" column="balance" />
|
||||
<result property="availableLimit" column="available_limit" />
|
||||
<result property="status" column="status" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectBankCardLendVo">
|
||||
select
|
||||
a.id,
|
||||
a.name,
|
||||
a.type,
|
||||
a.code,
|
||||
a.opening_bank,
|
||||
a.activation_date,
|
||||
a.bill_date,
|
||||
a.pay_date,
|
||||
a.delay_period,
|
||||
a.credit_limit,
|
||||
a.effective_date,
|
||||
a.cvv,
|
||||
a.create_by,
|
||||
a.create_time,
|
||||
a.update_by,
|
||||
a.update_time,
|
||||
a.del_flag,
|
||||
a.remark,
|
||||
a.debit_type,
|
||||
a.lend_type,
|
||||
a.is_next_bill_date,
|
||||
a.next_bill_date_time,
|
||||
a.is_zero_bill,
|
||||
a.status,
|
||||
t.balance,
|
||||
t.available_limit
|
||||
from bank_card_lend a
|
||||
left join accounts t on t.id=a.id
|
||||
</sql>
|
||||
|
||||
<select id="selectBankCardLendList" parameterType="BankCardLendDto" resultMap="BankCardLendResult">
|
||||
<include refid="selectBankCardLendVo"/>
|
||||
<where>
|
||||
a.del_flag='0'
|
||||
<if test="name != null and name != ''"> and a.name like '%'|| #{name}||'%'</if>
|
||||
<if test="code != null and code != ''"> and a.code like '%'|| #{code}||'%'</if>
|
||||
<if test="type != null and type != ''"> and a.type = #{type}</if>
|
||||
<if test="debitType != null and debitType != ''"> and a.debit_type = #{debitType}</if>
|
||||
<if test="creditCardId != null "> and a.id = #{creditCardId}</if>
|
||||
<if test="lendType != null and lendType != ''"> and a.lend_type = #{lendType}</if>
|
||||
<if test="status != null and status != ''"> and a.status = #{status}</if>
|
||||
<if test="repayFlag != null and repayFlag != ''"> and a.debit_type in('1','2','3')</if>
|
||||
</where>
|
||||
<!-- 数据范围过滤 -->
|
||||
${params.dataScope}
|
||||
order by a.type asc, a.bill_date asc,a.debit_type asc,a.update_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectBankCardLendById" parameterType="Long" resultMap="BankCardLendResult">
|
||||
<include refid="selectBankCardLendVo"/>
|
||||
where a.id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertBankCardLend" parameterType="BankCardLend">
|
||||
insert into bank_card_lend
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</if>
|
||||
<if test="name != null and name != ''">name,</if>
|
||||
<if test="type != null and type != ''">type,</if>
|
||||
<if test="code != null and code != ''">code,</if>
|
||||
<if test="openingBank != null">opening_bank,</if>
|
||||
<if test="activationDate != null">activation_date,</if>
|
||||
<if test="billDate != null and billDate != ''">bill_date,</if>
|
||||
<if test="payDate != null and payDate != ''">pay_date,</if>
|
||||
<if test="delayPeriod != null">delay_period,</if>
|
||||
<if test="creditLimit != null">credit_limit,</if>
|
||||
<if test="effectiveDate != null">effective_date,</if>
|
||||
<if test="cvv != null and cvv != ''">cvv,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="debitType != null">debit_type,</if>
|
||||
<if test="lendType != null">lend_type,</if>
|
||||
<if test="isNextBillDate != null">is_next_bill_date,</if>
|
||||
<if test="nextBillDateTime != null">next_bill_date_time,</if>
|
||||
<if test="isZeroBill != null">is_zero_bill,</if>
|
||||
<if test="status != null">status,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
<if test="name != null and name != ''">#{name},</if>
|
||||
<if test="type != null and type != ''">#{type},</if>
|
||||
<if test="code != null and code != ''">#{code},</if>
|
||||
<if test="openingBank != null">#{openingBank},</if>
|
||||
<if test="activationDate != null">#{activationDate},</if>
|
||||
<if test="billDate != null and billDate != ''">#{billDate},</if>
|
||||
<if test="payDate != null and payDate != ''">#{payDate},</if>
|
||||
<if test="delayPeriod != null">#{delayPeriod},</if>
|
||||
<if test="creditLimit != null ">#{creditLimit},</if>
|
||||
<if test="effectiveDate != null">#{effectiveDate},</if>
|
||||
<if test="cvv != null and cvv != ''">#{cvv},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="debitType != null">#{debitType},</if>
|
||||
<if test="lendType != null">#{lendType},</if>
|
||||
<if test="isNextBillDate != null">#{isNextBillDate},</if>
|
||||
<if test="nextBillDateTime != null">#{nextBillDateTime},</if>
|
||||
<if test="isZeroBill != null">#{isZeroBill},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateBankCardLend" parameterType="BankCardLend">
|
||||
update bank_card_lend
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="name != null and name != ''">name = #{name},</if>
|
||||
<if test="type != null and type != ''">type = #{type},</if>
|
||||
<if test="code != null and code != ''">code = #{code},</if>
|
||||
<if test="openingBank != null">opening_bank = #{openingBank},</if>
|
||||
<if test="activationDate != null">activation_date = #{activationDate},</if>
|
||||
<if test="billDate != null and billDate != ''">bill_date = #{billDate},</if>
|
||||
<if test="payDate != null and payDate != ''">pay_date = #{payDate},</if>
|
||||
<if test="delayPeriod != null">delay_period = #{delayPeriod},</if>
|
||||
<if test="creditLimit != null">credit_limit = #{creditLimit},</if>
|
||||
<if test="effectiveDate != null">effective_date = #{effectiveDate},</if>
|
||||
<if test="cvv != null and cvv != ''">cvv = #{cvv},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="debitType != null">debit_type = #{debitType},</if>
|
||||
<if test="lendType != null">lend_type = #{lendType},</if>
|
||||
<if test="isNextBillDate != null">is_next_bill_date = #{isNextBillDate},</if>
|
||||
<if test="nextBillDateTime != null">next_bill_date_time = #{nextBillDateTime},</if>
|
||||
<if test="isZeroBill != null">is_zero_bill = #{isZeroBill},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteBankCardLendById" parameterType="Long">
|
||||
delete from bank_card_lend where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteBankCardLendByIds" parameterType="String">
|
||||
delete from bank_card_lend where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
<update id="removeBankCardLendById" parameterType="Long">
|
||||
update bank_card_lend set del_flag='1' where id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="removeBankCardLendByIds" parameterType="String">
|
||||
update bank_card_lend set del_flag='1' where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</update>
|
||||
</mapper>
|
||||
@@ -0,0 +1,139 @@
|
||||
<?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.intc.invest.mapper.BankCardLimitHistoryMapper">
|
||||
|
||||
<resultMap type="BankCardLimitHistoryVo" id="BankCardLimitHistoryResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="name" column="name" />
|
||||
<result property="type" column="type" />
|
||||
<result property="bankCardLendId" column="bank_card_lend_id" />
|
||||
<result property="afterLimit" column="after_limit" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="adjustTime" column="adjust_time" />
|
||||
<result property="effectDate" column="effect_date" />
|
||||
<result property="deadlineDate" column="deadline_date" />
|
||||
<result property="adjustType" column="adjust_type" />
|
||||
<result property="beforeLimit" column="before_limit" />
|
||||
<result property="adjustLimit" column="adjust_limit" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectBankCardLimitHistoryVo">
|
||||
select a.id, a.name, a.type, a.bank_card_lend_id, a.after_limit, a.create_by, a.create_time, a.update_by, a.update_time, a.del_flag, a.remark, a.adjust_time, a.effect_date, a.deadline_date, a.adjust_type, a.before_limit, a.adjust_limit from bank_card_limit_history a
|
||||
</sql>
|
||||
|
||||
<select id="selectBankCardLimitHistoryList" parameterType="BankCardLimitHistoryDto" resultMap="BankCardLimitHistoryResult">
|
||||
<include refid="selectBankCardLimitHistoryVo"/>
|
||||
<where>
|
||||
a.del_flag='0'
|
||||
<if test="name != null and name != ''"> and a.name like '%'|| #{name}||'%'</if>
|
||||
<if test="type != null and type != ''"> and a.type = #{type}</if>
|
||||
<if test="bankCardLendId != null "> and a.bank_card_lend_id = #{bankCardLendId}</if>
|
||||
<if test="afterLimit != null "> and a.after_limit = #{afterLimit}</if>
|
||||
<if test="adjustTime != null "> and a.adjust_time = #{adjustTime}</if>
|
||||
<if test="effectDate != null "> and a.effect_date = #{effectDate}</if>
|
||||
<if test="deadlineDate != null "> and a.deadline_date = #{deadlineDate}</if>
|
||||
<if test="adjustType != null and adjustType != ''"> and a.adjust_type = #{adjustType}</if>
|
||||
<if test="beforeLimit != null "> and a.before_limit = #{beforeLimit}</if>
|
||||
<if test="adjustLimit != null "> and a.adjust_limit = #{adjustLimit}</if>
|
||||
</where>
|
||||
order by a.create_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectBankCardLimitHistoryById" parameterType="Long" resultMap="BankCardLimitHistoryResult">
|
||||
<include refid="selectBankCardLimitHistoryVo"/>
|
||||
where a.id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertBankCardLimitHistory" parameterType="BankCardLimitHistory">
|
||||
insert into bank_card_limit_history
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</if>
|
||||
<if test="name != null">name,</if>
|
||||
<if test="type != null">type,</if>
|
||||
<if test="bankCardLendId != null">bank_card_lend_id,</if>
|
||||
<if test="afterLimit != null">after_limit,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="adjustTime != null">adjust_time,</if>
|
||||
<if test="effectDate != null">effect_date,</if>
|
||||
<if test="deadlineDate != null">deadline_date,</if>
|
||||
<if test="adjustType != null and adjustType != ''">adjust_type,</if>
|
||||
<if test="beforeLimit != null">before_limit,</if>
|
||||
<if test="adjustLimit != null">adjust_limit,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
<if test="name != null">#{name},</if>
|
||||
<if test="type != null">#{type},</if>
|
||||
<if test="bankCardLendId != null">#{bankCardLendId},</if>
|
||||
<if test="afterLimit != null">#{afterLimit},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="adjustTime != null">#{adjustTime},</if>
|
||||
<if test="effectDate != null">#{effectDate},</if>
|
||||
<if test="deadlineDate != null">#{deadlineDate},</if>
|
||||
<if test="adjustType != null and adjustType != ''">#{adjustType},</if>
|
||||
<if test="beforeLimit != null">#{beforeLimit},</if>
|
||||
<if test="adjustLimit != null">#{adjustLimit},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateBankCardLimitHistory" parameterType="BankCardLimitHistory">
|
||||
update bank_card_limit_history
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="name != null">name = #{name},</if>
|
||||
<if test="type != null">type = #{type},</if>
|
||||
<if test="bankCardLendId != null">bank_card_lend_id = #{bankCardLendId},</if>
|
||||
<if test="afterLimit != null">after_limit = #{afterLimit},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="adjustTime != null">adjust_time = #{adjustTime},</if>
|
||||
<if test="effectDate != null">effect_date = #{effectDate},</if>
|
||||
<if test="deadlineDate != null">deadline_date = #{deadlineDate},</if>
|
||||
<if test="adjustType != null and adjustType != ''">adjust_type = #{adjustType},</if>
|
||||
<if test="beforeLimit != null">before_limit = #{beforeLimit},</if>
|
||||
<if test="adjustLimit != null">adjust_limit = #{adjustLimit},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteBankCardLimitHistoryById" parameterType="Long">
|
||||
delete from bank_card_limit_history where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteBankCardLimitHistoryByIds" parameterType="String">
|
||||
delete from bank_card_limit_history where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
<update id="removeBankCardLimitHistoryById" parameterType="Long">
|
||||
update bank_card_limit_history set del_flag='1' where id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="removeBankCardLimitHistoryByIds" parameterType="String">
|
||||
update bank_card_limit_history set del_flag='1' where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</update>
|
||||
</mapper>
|
||||
@@ -0,0 +1,188 @@
|
||||
<?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.intc.invest.mapper.CreditCardBillMapper">
|
||||
|
||||
<resultMap type="CreditCardBillVo" id="CreditCardBillResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="name" column="name" />
|
||||
<result property="billDate" column="bill_date" />
|
||||
<result property="creditCardId" column="credit_card_id" />
|
||||
<result property="billDatePeriod" column="bill_date_period" />
|
||||
<result property="billAmount" column="bill_amount" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="billState" column="bill_state" />
|
||||
<result property="bankName" column="bank_name" />
|
||||
<result property="bankCode" column="bank_code" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="posCount" column="pos_count" />
|
||||
<result property="dailyExpensesCount" column="daily_expenses_count" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectCreditCardBillVo">
|
||||
select
|
||||
a.id,
|
||||
a.name,
|
||||
a.bill_date,
|
||||
a.credit_card_id,
|
||||
a.bill_date_period,
|
||||
a.bill_amount,
|
||||
a.create_by,
|
||||
a.create_time,
|
||||
a.update_by,
|
||||
a.update_time,
|
||||
a.del_flag,
|
||||
a.bill_state,
|
||||
a.remark,
|
||||
bc."name" as bank_name,
|
||||
bc.code as bank_code,
|
||||
(
|
||||
select
|
||||
count(*)
|
||||
from
|
||||
accounts_deal_record adr
|
||||
where
|
||||
adr.account_id = a.credit_card_id
|
||||
and adr.deal_type = '2'
|
||||
and to_char(adr.create_time,
|
||||
'yyyy-MM-dd')>=split_part(a.bill_date_period,
|
||||
'~',
|
||||
1)
|
||||
and split_part(a.bill_date_period,
|
||||
'~',
|
||||
2)>= to_char(adr.create_time,
|
||||
'yyyy-MM-dd')
|
||||
and adr.deal_category = '5'
|
||||
and adr.del_flag='0'
|
||||
) as pos_count,
|
||||
(
|
||||
select
|
||||
count(*)
|
||||
from
|
||||
accounts_deal_record adr
|
||||
where
|
||||
adr.account_id = a.credit_card_id
|
||||
and adr.deal_type = '2'
|
||||
and to_char(adr.create_time,
|
||||
'yyyy-MM-dd')>=split_part(a.bill_date_period,
|
||||
'~',
|
||||
1)
|
||||
and split_part(a.bill_date_period,
|
||||
'~',
|
||||
2)>= to_char(adr.create_time,
|
||||
'yyyy-MM-dd')
|
||||
and adr.deal_category = '1'
|
||||
and adr.del_flag='0'
|
||||
) as daily_expenses_count
|
||||
from
|
||||
credit_card_bill a
|
||||
left join bank_card_lend bc on
|
||||
bc.id = a.credit_card_id
|
||||
</sql>
|
||||
|
||||
<select id="selectCreditCardBillList" parameterType="CreditCardBillDto" resultMap="CreditCardBillResult">
|
||||
<include refid="selectCreditCardBillVo"/>
|
||||
<where>
|
||||
a.del_flag='0'
|
||||
<if test="name != null and name != ''"> and a.name like '%'|| #{name}||'%'</if>
|
||||
<if test="creditCardId != null "> and a.credit_card_id = #{creditCardId}</if>
|
||||
<if test="billState != null and billState != ''"> and a.bill_state = #{billState}</if>
|
||||
<if test="startMonth!=null and startMonth !=''">
|
||||
and to_char(a.bill_date, 'yyyy-MM')>=#{startMonth}
|
||||
</if>
|
||||
<if test="endMonth!=null and endMonth !=''">
|
||||
and #{endMonth}>=to_char(a.bill_date, 'yyyy-MM')
|
||||
</if>
|
||||
<if test="billDate!=null and billDate !=''">
|
||||
and #{billDate}=to_char(a.bill_date, 'yyyy-MM-dd')
|
||||
</if>
|
||||
</where>
|
||||
<!-- 数据范围过滤 -->
|
||||
${params.dataScope}
|
||||
order by a.bill_date desc
|
||||
</select>
|
||||
|
||||
<select id="selectCreditCardBillById" parameterType="Long" resultMap="CreditCardBillResult">
|
||||
<include refid="selectCreditCardBillVo"/>
|
||||
where a.id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertCreditCardBill" parameterType="CreditCardBill">
|
||||
insert into credit_card_bill
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</if>
|
||||
<if test="name != null">name,</if>
|
||||
<if test="billDate != null">bill_date,</if>
|
||||
<if test="creditCardId != null">credit_card_id,</if>
|
||||
<if test="billDatePeriod != null">bill_date_period,</if>
|
||||
<if test="billAmount != null">bill_amount,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
<if test="billState != null">bill_state,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
<if test="name != null">#{name},</if>
|
||||
<if test="billDate != null">#{billDate},</if>
|
||||
<if test="creditCardId != null">#{creditCardId},</if>
|
||||
<if test="billDatePeriod != null">#{billDatePeriod},</if>
|
||||
<if test="billAmount != null">#{billAmount},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
<if test="billState != null">#{billState},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateCreditCardBill" parameterType="CreditCardBill">
|
||||
update credit_card_bill
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="name != null">name = #{name},</if>
|
||||
<if test="billDate != null">bill_date = #{billDate},</if>
|
||||
<if test="creditCardId != null">credit_card_id = #{creditCardId},</if>
|
||||
<if test="billDatePeriod != null">bill_date_period = #{billDatePeriod},</if>
|
||||
<if test="billAmount != null">bill_amount = #{billAmount},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
<if test="billState != null">bill_state = #{billState},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteCreditCardBillById" parameterType="Long">
|
||||
delete from credit_card_bill where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteCreditCardBillByIds" parameterType="String">
|
||||
delete from credit_card_bill where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
<update id="removeCreditCardBillById" parameterType="Long">
|
||||
update credit_card_bill set del_flag='1' where id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="removeCreditCardBillByIds" parameterType="String">
|
||||
update credit_card_bill set del_flag='1' where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</update>
|
||||
</mapper>
|
||||
@@ -0,0 +1,131 @@
|
||||
<?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.intc.invest.mapper.CreditReportQueryRecordMapper">
|
||||
|
||||
<resultMap type="CreditReportQueryRecordVo" id="CreditReportQueryRecordResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="queryInstitution" column="query_institution" />
|
||||
<result property="type" column="type" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="queryDate" column="query_date" />
|
||||
<result property="queryType" column="query_type" />
|
||||
<result property="queryCount" column="query_count" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectCreditReportQueryRecordVo">
|
||||
select a.id, a.query_institution,a.query_count, a.type,a.query_type, a.create_by, a.create_time, a.update_by, a.update_time, a.del_flag, a.remark, a.query_date from credit_report_query_record a
|
||||
</sql>
|
||||
|
||||
<select id="selectCreditReportQueryRecordList" parameterType="CreditReportQueryRecordDto" resultMap="CreditReportQueryRecordResult">
|
||||
<include refid="selectCreditReportQueryRecordVo"/>
|
||||
<where>
|
||||
a.del_flag='0'
|
||||
<if test="queryInstitution != null and queryInstitution != ''"> and a.query_institution like '%'|| #{queryInstitution}||'%'</if>
|
||||
<if test="type != null and type != ''"> and a.type = #{type}</if>
|
||||
<if test="queryType != null and queryType != ''"> and a.query_type= #{queryType}</if>
|
||||
<if test="queryDateStart!=null and queryDateStart !=''">
|
||||
and to_char(a.query_date, 'yyyy-MM-dd')>=#{queryDateStart}
|
||||
</if>
|
||||
<if test="queryDateEnd!=null and queryDateEnd !=''">
|
||||
and #{queryDateEnd}>=to_char(a.query_date, 'yyyy-MM-dd')
|
||||
</if>
|
||||
</where>
|
||||
<!-- 数据范围过滤 -->
|
||||
${params.dataScope}
|
||||
order by a.query_date desc
|
||||
</select>
|
||||
|
||||
<select id="selectCreditReportQueryRecordById" parameterType="Long" resultMap="CreditReportQueryRecordResult">
|
||||
<include refid="selectCreditReportQueryRecordVo"/>
|
||||
where a.id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertCreditReportQueryRecord" parameterType="CreditReportQueryRecord">
|
||||
insert into credit_report_query_record
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</if>
|
||||
<if test="queryInstitution != null">query_institution,</if>
|
||||
<if test="type != null">type,</if>
|
||||
<if test="queryType != null">query_type,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="queryDate != null">query_date,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
<if test="queryInstitution != null">#{queryInstitution},</if>
|
||||
<if test="type != null">#{type},</if>
|
||||
<if test="queryType != null">#{queryType},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="queryDate != null">#{queryDate},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateCreditReportQueryRecord" parameterType="CreditReportQueryRecord">
|
||||
update credit_report_query_record
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="queryInstitution != null">query_institution = #{queryInstitution},</if>
|
||||
<if test="type != null">type = #{type},</if>
|
||||
<if test="queryType != null">query_type = #{queryType},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="queryDate != null">query_date = #{queryDate},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteCreditReportQueryRecordById" parameterType="Long">
|
||||
delete from credit_report_query_record where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteCreditReportQueryRecordByIds" parameterType="String">
|
||||
delete from credit_report_query_record where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
<update id="removeCreditReportQueryRecordById" parameterType="Long">
|
||||
update credit_report_query_record set del_flag='1' where id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="removeCreditReportQueryRecordByIds" parameterType="String">
|
||||
update credit_report_query_record set del_flag='1' where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</update>
|
||||
<select id="selectQueryInstitutionList" parameterType="CreditReportQueryRecordDto" resultMap="CreditReportQueryRecordResult">
|
||||
select
|
||||
distinct
|
||||
a.query_institution
|
||||
from
|
||||
credit_report_query_record a
|
||||
where
|
||||
a.del_flag = '0'
|
||||
<!-- 数据范围过滤 -->
|
||||
${params.dataScope}
|
||||
order by
|
||||
a.query_institution desc
|
||||
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,166 @@
|
||||
<?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.intc.invest.mapper.DebitInforsMapper">
|
||||
|
||||
<resultMap type="DebitInforsVo" id="DebitInforsResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="name" column="name" />
|
||||
<result property="type" column="type" />
|
||||
<result property="lenders" column="lenders" />
|
||||
<result property="applicableCustomerGroups" column="applicable_customer_groups" />
|
||||
<result property="requiredMaterials" column="required_materials" />
|
||||
<result property="creditConditions" column="credit_conditions" />
|
||||
<result property="lendingRate" column="lending_rate" />
|
||||
<result property="loanTerm" column="loan_term" />
|
||||
<result property="repaymentMethod" column="repayment_method" />
|
||||
<result property="loanLimit" column="loan_limit" />
|
||||
<result property="loanPurpose" column="loan_purpose" />
|
||||
<result property="applyMethod" column="apply_method" />
|
||||
<result property="creditQueryCount" column="credit_query_count" />
|
||||
<result property="debtCount" column="debt_count" />
|
||||
<result property="creditCardCount" column="credit_card_count" />
|
||||
<result property="creditCardUsageRate" column="credit_card_usage_rate" />
|
||||
<result property="loanBalance" column="loan_balance" />
|
||||
<result property="debtRequirements" column="debt_requirements" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="remark" column="remark" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectDebitInforsVo">
|
||||
select a.id, a.name, a.type, a.lenders, a.applicable_customer_groups, a.required_materials, a.credit_conditions, a.lending_rate, a.loan_term, a.repayment_method, a.loan_limit, a.loan_purpose, a.apply_method, a.credit_query_count, a.debt_count, a.credit_card_count, a.credit_card_usage_rate, a.loan_balance, a.debt_requirements, a.create_by, a.create_time, a.update_by, a.update_time, a.del_flag, a.remark from debit_infors a
|
||||
</sql>
|
||||
|
||||
<select id="selectDebitInforsList" parameterType="DebitInforsDto" resultMap="DebitInforsResult">
|
||||
<include refid="selectDebitInforsVo"/>
|
||||
<where>
|
||||
a.del_flag='0'
|
||||
<if test="name != null and name != ''"> and a.name like '%'|| #{name}||'%'</if>
|
||||
<if test="type != null and type != ''"> and a.type = #{type}</if>
|
||||
<if test="lenders != null and lenders != ''"> and a.lenders = #{lenders}</if>
|
||||
</where>
|
||||
<!-- 数据范围过滤 -->
|
||||
${params.dataScope}
|
||||
order by a.create_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectDebitInforsById" parameterType="Long" resultMap="DebitInforsResult">
|
||||
<include refid="selectDebitInforsVo"/>
|
||||
where a.id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertDebitInfors" parameterType="DebitInfors">
|
||||
insert into debit_infors
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</if>
|
||||
<if test="name != null and name != ''">name,</if>
|
||||
<if test="type != null">type,</if>
|
||||
<if test="lenders != null and lenders != ''">lenders,</if>
|
||||
<if test="applicableCustomerGroups != null">applicable_customer_groups,</if>
|
||||
<if test="requiredMaterials != null">required_materials,</if>
|
||||
<if test="creditConditions != null">credit_conditions,</if>
|
||||
<if test="lendingRate != null">lending_rate,</if>
|
||||
<if test="loanTerm != null">loan_term,</if>
|
||||
<if test="repaymentMethod != null">repayment_method,</if>
|
||||
<if test="loanLimit != null">loan_limit,</if>
|
||||
<if test="loanPurpose != null">loan_purpose,</if>
|
||||
<if test="applyMethod != null">apply_method,</if>
|
||||
<if test="creditQueryCount != null">credit_query_count,</if>
|
||||
<if test="debtCount != null">debt_count,</if>
|
||||
<if test="creditCardCount != null">credit_card_count,</if>
|
||||
<if test="creditCardUsageRate != null">credit_card_usage_rate,</if>
|
||||
<if test="loanBalance != null">loan_balance,</if>
|
||||
<if test="debtRequirements != null">debt_requirements,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
<if test="name != null and name != ''">#{name},</if>
|
||||
<if test="type != null">#{type},</if>
|
||||
<if test="lenders != null and lenders != ''">#{lenders},</if>
|
||||
<if test="applicableCustomerGroups != null">#{applicableCustomerGroups},</if>
|
||||
<if test="requiredMaterials != null">#{requiredMaterials},</if>
|
||||
<if test="creditConditions != null">#{creditConditions},</if>
|
||||
<if test="lendingRate != null">#{lendingRate},</if>
|
||||
<if test="loanTerm != null">#{loanTerm},</if>
|
||||
<if test="repaymentMethod != null">#{repaymentMethod},</if>
|
||||
<if test="loanLimit != null">#{loanLimit},</if>
|
||||
<if test="loanPurpose != null">#{loanPurpose},</if>
|
||||
<if test="applyMethod != null">#{applyMethod},</if>
|
||||
<if test="creditQueryCount != null">#{creditQueryCount},</if>
|
||||
<if test="debtCount != null">#{debtCount},</if>
|
||||
<if test="creditCardCount != null">#{creditCardCount},</if>
|
||||
<if test="creditCardUsageRate != null">#{creditCardUsageRate},</if>
|
||||
<if test="loanBalance != null">#{loanBalance},</if>
|
||||
<if test="debtRequirements != null">#{debtRequirements},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateDebitInfors" parameterType="DebitInfors">
|
||||
update debit_infors
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="name != null and name != ''">name = #{name},</if>
|
||||
<if test="type != null">type = #{type},</if>
|
||||
<if test="lenders != null and lenders != ''">lenders = #{lenders},</if>
|
||||
<if test="applicableCustomerGroups != null">applicable_customer_groups = #{applicableCustomerGroups},</if>
|
||||
<if test="requiredMaterials != null">required_materials = #{requiredMaterials},</if>
|
||||
<if test="creditConditions != null">credit_conditions = #{creditConditions},</if>
|
||||
<if test="lendingRate != null">lending_rate = #{lendingRate},</if>
|
||||
<if test="loanTerm != null">loan_term = #{loanTerm},</if>
|
||||
<if test="repaymentMethod != null">repayment_method = #{repaymentMethod},</if>
|
||||
<if test="loanLimit != null">loan_limit = #{loanLimit},</if>
|
||||
<if test="loanPurpose != null">loan_purpose = #{loanPurpose},</if>
|
||||
<if test="applyMethod != null">apply_method = #{applyMethod},</if>
|
||||
<if test="creditQueryCount != null">credit_query_count = #{creditQueryCount},</if>
|
||||
<if test="debtCount != null">debt_count = #{debtCount},</if>
|
||||
<if test="creditCardCount != null">credit_card_count = #{creditCardCount},</if>
|
||||
<if test="creditCardUsageRate != null">credit_card_usage_rate = #{creditCardUsageRate},</if>
|
||||
<if test="loanBalance != null">loan_balance = #{loanBalance},</if>
|
||||
<if test="debtRequirements != null">debt_requirements = #{debtRequirements},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteDebitInforsById" parameterType="Long">
|
||||
delete from debit_infors where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteDebitInforsByIds" parameterType="String">
|
||||
delete from debit_infors where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
<update id="removeDebitInforsById" parameterType="Long">
|
||||
update debit_infors set del_flag='1' where id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="removeDebitInforsByIds" parameterType="String">
|
||||
update debit_infors set del_flag='1' where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</update>
|
||||
</mapper>
|
||||
@@ -0,0 +1,159 @@
|
||||
<?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.intc.invest.mapper.FutureStocksBillMapper">
|
||||
|
||||
<resultMap type="FutureStocksBillVo" id="FutureStocksBillResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="name" column="name" />
|
||||
<result property="billDate" column="bill_date" />
|
||||
<result property="futureStocksId" column="future_stocks_id" />
|
||||
<result property="billDatePeriod" column="bill_date_period" />
|
||||
<result property="billAmount" column="bill_amount" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="type" column="type" />
|
||||
<result property="billYear" column="bill_year" />
|
||||
<result property="billMonth" column="bill_month" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="futureStocksName" column="future_stocks_name" />
|
||||
<result property="futureStocksCode" column="future_stocks_code" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectFutureStocksBillVo">
|
||||
select
|
||||
a.id,
|
||||
a.name,
|
||||
a.bill_date,
|
||||
a.future_stocks_id,
|
||||
a.bill_date_period,
|
||||
a.bill_amount,
|
||||
a.create_by,
|
||||
a.create_time,
|
||||
a.update_by,
|
||||
a.update_time,
|
||||
a.del_flag,
|
||||
a.type,
|
||||
a.bill_year,
|
||||
a.bill_month,
|
||||
a.remark,
|
||||
fs2 ."name" as future_stocks_name,
|
||||
fs2.code as future_stocks_code
|
||||
from
|
||||
future_stocks_bill a
|
||||
left join future_stocks fs2 on fs2 .id =a.future_stocks_id
|
||||
|
||||
</sql>
|
||||
|
||||
<select id="selectFutureStocksBillList" parameterType="FutureStocksBillDto" resultMap="FutureStocksBillResult">
|
||||
<include refid="selectFutureStocksBillVo"/>
|
||||
<where>
|
||||
a.del_flag='0'
|
||||
<if test="name != null and name != ''"> and a.name like '%'|| #{name}||'%'</if>
|
||||
<if test="billDate != null "> and a.bill_date = #{billDate}</if>
|
||||
<if test="futureStocksId != null "> and a.future_stocks_id = #{futureStocksId}</if>
|
||||
<if test="billDatePeriod != null and billDatePeriod != ''"> and a.bill_date_period = #{billDatePeriod}</if>
|
||||
<if test="billAmount != null and billAmount != ''"> and a.bill_amount = #{billAmount}</if>
|
||||
<if test="type != null and type != ''"> and a.type = #{type}</if>
|
||||
<if test="billMonth != null "> and a.bill_month = #{billMonth}</if>
|
||||
<if test="startMonth!=null and startMonth !=''">
|
||||
and to_char(a.bill_date, 'yyyy-MM')>=#{startMonth}
|
||||
</if>
|
||||
<if test="endMonth!=null and endMonth !=''">
|
||||
and #{endMonth}>=to_char(a.bill_date, 'yyyy-MM')
|
||||
</if>
|
||||
</where>
|
||||
<!-- 数据范围过滤 -->
|
||||
${params.dataScope}
|
||||
order by a.bill_date_period desc
|
||||
</select>
|
||||
|
||||
<select id="selectFutureStocksBillById" parameterType="Long" resultMap="FutureStocksBillResult">
|
||||
<include refid="selectFutureStocksBillVo"/>
|
||||
where a.id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertFutureStocksBill" parameterType="FutureStocksBill">
|
||||
insert into future_stocks_bill
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</if>
|
||||
<if test="name != null">name,</if>
|
||||
<if test="billDate != null">bill_date,</if>
|
||||
<if test="futureStocksId != null">future_stocks_id,</if>
|
||||
<if test="billDatePeriod != null">bill_date_period,</if>
|
||||
<if test="billAmount != null">bill_amount,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
<if test="type != null">type,</if>
|
||||
<if test="billYear != null">bill_year,</if>
|
||||
<if test="billMonth != null">bill_month,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
<if test="name != null">#{name},</if>
|
||||
<if test="billDate != null">#{billDate},</if>
|
||||
<if test="futureStocksId != null">#{futureStocksId},</if>
|
||||
<if test="billDatePeriod != null">#{billDatePeriod},</if>
|
||||
<if test="billAmount != null">#{billAmount},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
<if test="type != null">#{type},</if>
|
||||
<if test="billYear != null">#{billYear},</if>
|
||||
<if test="billMonth != null">#{billMonth},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateFutureStocksBill" parameterType="FutureStocksBill">
|
||||
update future_stocks_bill
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="name != null">name = #{name},</if>
|
||||
<if test="billDate != null">bill_date = #{billDate},</if>
|
||||
<if test="futureStocksId != null">future_stocks_id = #{futureStocksId},</if>
|
||||
<if test="billDatePeriod != null">bill_date_period = #{billDatePeriod},</if>
|
||||
<if test="billAmount != null">bill_amount = #{billAmount},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
<if test="type != null">type = #{type},</if>
|
||||
<if test="billYear != null">bill_year = #{billYear},</if>
|
||||
<if test="billMonth != null">bill_month = #{billMonth},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteFutureStocksBillById" parameterType="Long">
|
||||
delete from future_stocks_bill where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteFutureStocksBillByIds" parameterType="String">
|
||||
delete from future_stocks_bill where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
<update id="removeFutureStocksBillById" parameterType="Long">
|
||||
update future_stocks_bill set del_flag='1' where id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="removeFutureStocksBillByIds" parameterType="String">
|
||||
update future_stocks_bill set del_flag='1' where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</update>
|
||||
</mapper>
|
||||
@@ -0,0 +1,174 @@
|
||||
<?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.intc.invest.mapper.FutureStocksMapper">
|
||||
|
||||
<resultMap type="FutureStocksVo" id="FutureStocksResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="name" column="name" />
|
||||
<result property="type" column="type" />
|
||||
<result property="code" column="code" />
|
||||
<result property="password" column="password" />
|
||||
<result property="tradingCenterCode" column="trading_center_code" />
|
||||
<result property="tradingCenterPassword" column="trading_center_password" />
|
||||
<result property="fundPassword" column="fund_password" />
|
||||
<result property="commission" column="commission" />
|
||||
<result property="bond" column="bond" />
|
||||
<result property="debitCard" column="debit_card" />
|
||||
<result property="activationDate" column="activation_date" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="bankName" column="bank_name" />
|
||||
<result property="bankCode" column="bank_code" />
|
||||
<result property="balance" column="balance" />
|
||||
<result property="availableLimit" column="available_limit" />
|
||||
<result property="status" column="status" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectFutureStocksVo">
|
||||
select
|
||||
a.id,
|
||||
a.name,
|
||||
a.type,
|
||||
a.code,
|
||||
a.password,
|
||||
a.trading_center_code,
|
||||
a.trading_center_password,
|
||||
a.fund_password,
|
||||
a.commission,
|
||||
a.bond,
|
||||
a.debit_card,
|
||||
a.activation_date,
|
||||
a.create_by,
|
||||
a.create_time,
|
||||
a.update_by,
|
||||
a.update_time,
|
||||
a.del_flag,
|
||||
a.remark ,
|
||||
a.status,
|
||||
bc."name" as bank_name,
|
||||
bc.code as bank_code,
|
||||
t.balance,
|
||||
t.available_limit
|
||||
from
|
||||
future_stocks a
|
||||
left join bank_card_lend bc on
|
||||
bc.id = a.debit_card
|
||||
left join accounts t on t.id=a.id
|
||||
</sql>
|
||||
|
||||
<select id="selectFutureStocksList" parameterType="FutureStocksDto" resultMap="FutureStocksResult">
|
||||
<include refid="selectFutureStocksVo"/>
|
||||
<where>
|
||||
a.del_flag='0'
|
||||
<if test="name != null and name != ''"> and a.name like '%'|| #{name}||'%'</if>
|
||||
<if test="type != null and type != ''"> and a.type = #{type}</if>
|
||||
<if test="status != null and status != ''"> and a.status = #{status}</if>
|
||||
</where>
|
||||
<!-- 数据范围过滤 -->
|
||||
${params.dataScope}
|
||||
order by a.create_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectFutureStocksById" parameterType="Long" resultMap="FutureStocksResult">
|
||||
<include refid="selectFutureStocksVo"/>
|
||||
where a.id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertFutureStocks" parameterType="FutureStocks">
|
||||
insert into future_stocks
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</if>
|
||||
<if test="name != null and name != ''">name,</if>
|
||||
<if test="type != null">type,</if>
|
||||
<if test="code != null and code != ''">code,</if>
|
||||
<if test="password != null and password != ''">password,</if>
|
||||
<if test="tradingCenterCode != null and tradingCenterCode != ''">trading_center_code,</if>
|
||||
<if test="tradingCenterPassword != null and tradingCenterPassword != ''">trading_center_password,</if>
|
||||
<if test="fundPassword != null and fundPassword != ''">fund_password,</if>
|
||||
<if test="commission != null">commission,</if>
|
||||
<if test="bond != null">bond,</if>
|
||||
<if test="debitCard != null and debitCard != ''">debit_card,</if>
|
||||
<if test="activationDate != null">activation_date,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="status != null">status,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
<if test="name != null and name != ''">#{name},</if>
|
||||
<if test="type != null">#{type},</if>
|
||||
<if test="code != null and code != ''">#{code},</if>
|
||||
<if test="password != null and password != ''">#{password},</if>
|
||||
<if test="tradingCenterCode != null and tradingCenterCode != ''">#{tradingCenterCode},</if>
|
||||
<if test="tradingCenterPassword != null and tradingCenterPassword != ''">#{tradingCenterPassword},</if>
|
||||
<if test="fundPassword != null and fundPassword != ''">#{fundPassword},</if>
|
||||
<if test="commission != null">#{commission},</if>
|
||||
<if test="bond != null">#{bond},</if>
|
||||
<if test="debitCard != null and debitCard != ''">#{debitCard},</if>
|
||||
<if test="activationDate != null">#{activationDate},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateFutureStocks" parameterType="FutureStocks">
|
||||
update future_stocks
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="name != null and name != ''">name = #{name},</if>
|
||||
<if test="type != null">type = #{type},</if>
|
||||
<if test="code != null and code != ''">code = #{code},</if>
|
||||
<if test="password != null and password != ''">password = #{password},</if>
|
||||
<if test="tradingCenterCode != null and tradingCenterCode != ''">trading_center_code = #{tradingCenterCode},</if>
|
||||
<if test="tradingCenterPassword != null and tradingCenterPassword != ''">trading_center_password = #{tradingCenterPassword},</if>
|
||||
<if test="fundPassword != null and fundPassword != ''">fund_password = #{fundPassword},</if>
|
||||
<if test="commission != null">commission = #{commission},</if>
|
||||
<if test="bond != null">bond = #{bond},</if>
|
||||
<if test="debitCard != null and debitCard != ''">debit_card = #{debitCard},</if>
|
||||
<if test="activationDate != null">activation_date = #{activationDate},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteFutureStocksById" parameterType="Long">
|
||||
delete from future_stocks where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteFutureStocksByIds" parameterType="String">
|
||||
delete from future_stocks where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
<update id="removeFutureStocksById" parameterType="Long">
|
||||
update future_stocks set del_flag='1' where id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="removeFutureStocksByIds" parameterType="String">
|
||||
update future_stocks set del_flag='1' where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</update>
|
||||
</mapper>
|
||||
@@ -0,0 +1,101 @@
|
||||
<?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.intc.invest.mapper.HeartJourneyMapper">
|
||||
|
||||
<resultMap type="HeartJourneyVo" id="HeartJourneyResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="name" column="name" />
|
||||
<result property="type" column="type" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectHeartJourneyVo">
|
||||
select a.id, a.name, a.type, a.remark, a.create_by, a.create_time, a.update_by, a.update_time, a.del_flag from heart_journey a
|
||||
</sql>
|
||||
|
||||
<select id="selectHeartJourneyList" parameterType="HeartJourneyDto" resultMap="HeartJourneyResult">
|
||||
<include refid="selectHeartJourneyVo"/>
|
||||
<where>
|
||||
a.del_flag='0'
|
||||
<if test="name != null and name != ''"> and a.name like '%'|| #{name}||'%'</if>
|
||||
<if test="type != null and type != ''"> and a.type = #{type}</if>
|
||||
</where>
|
||||
<!-- 数据范围过滤 -->
|
||||
${params.dataScope}
|
||||
order by a.create_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectHeartJourneyById" parameterType="Long" resultMap="HeartJourneyResult">
|
||||
<include refid="selectHeartJourneyVo"/>
|
||||
where a.id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertHeartJourney" parameterType="HeartJourney">
|
||||
insert into heart_journey
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</if>
|
||||
<if test="name != null and name != ''">name,</if>
|
||||
<if test="type != null and type != ''">type,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
<if test="name != null and name != ''">#{name},</if>
|
||||
<if test="type != null and type != ''">#{type},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateHeartJourney" parameterType="HeartJourney">
|
||||
update heart_journey
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="name != null and name != ''">name = #{name},</if>
|
||||
<if test="type != null and type != ''">type = #{type},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteHeartJourneyById" parameterType="Long">
|
||||
delete from heart_journey where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteHeartJourneyByIds" parameterType="String">
|
||||
delete from heart_journey where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
<update id="removeHeartJourneyById" parameterType="Long">
|
||||
update heart_journey set del_flag='1' where id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="removeHeartJourneyByIds" parameterType="String">
|
||||
update heart_journey set del_flag='1' where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</update>
|
||||
</mapper>
|
||||
@@ -0,0 +1,101 @@
|
||||
<?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.intc.invest.mapper.IItemMapper">
|
||||
|
||||
<resultMap type="IItemVo" id="IItemResult">
|
||||
<result property="itemId" column="item_id" />
|
||||
<result property="itemCode" column="item_code" />
|
||||
<result property="title" column="title" />
|
||||
<result property="content" column="content" />
|
||||
<result property="picture" column="picture" />
|
||||
<result property="pictureV2" column="picture_v2" />
|
||||
<result property="createTime" column="create_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectIItemVo">
|
||||
select a.item_id, a.item_code, a.title, a.content, a.picture, a.picture_v2, a.create_time from i_item a
|
||||
</sql>
|
||||
|
||||
<select id="selectIItemList" parameterType="IItemDto" resultMap="IItemResult">
|
||||
<include refid="selectIItemVo"/>
|
||||
<where>
|
||||
a.del_flag='0'
|
||||
<if test="itemCode != null and itemCode != ''"> and a.item_code like '%'|| #{itemCode}||'%'</if>
|
||||
<if test="title != null and title != ''"> and a.title like '%'|| #{title}||'%'</if>
|
||||
<if test="content != null and content != ''"> and a.content like '%'|| #{content}||'%'</if>
|
||||
</where>
|
||||
order by a.create_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectIItemByItemId" parameterType="Long" resultMap="IItemResult">
|
||||
<include refid="selectIItemVo"/>
|
||||
where a.item_id = #{itemId}
|
||||
</select>
|
||||
|
||||
<insert id="insertIItem" parameterType="IItem">
|
||||
insert into i_item
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="itemId != null">item_id,</if>
|
||||
<if test="itemCode != null">item_code,</if>
|
||||
<if test="title != null">title,</if>
|
||||
<if test="content != null">content,</if>
|
||||
<if test="pictureV2 != null">picture_v2,</if>
|
||||
<if test="picture != null">picture,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="itemId != null">#{itemId},</if>
|
||||
<if test="itemCode != null">#{itemCode},</if>
|
||||
<if test="title != null">#{title},</if>
|
||||
<if test="content != null">#{content},</if>
|
||||
<if test="pictureV2 != null">#{pictureV2},</if>
|
||||
<if test="picture != null">#{picture},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateIItem" parameterType="IItem">
|
||||
update i_item
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="itemCode != null">item_code = #{itemCode},</if>
|
||||
<if test="title != null">title = #{title},</if>
|
||||
<if test="content != null">content = #{content},</if>
|
||||
<if test="picture != null">picture = #{picture},</if>
|
||||
<if test="pictureV2 != null">picture_v2 = #{pictureV2},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
</trim>
|
||||
where item_id = #{itemId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteIItemByItemId" parameterType="Long">
|
||||
delete from i_item where item_id = #{itemId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteIItemByItemIds" parameterType="String">
|
||||
delete from i_item where item_id in
|
||||
<foreach item="itemId" collection="array" open="(" separator="," close=")">
|
||||
#{itemId}
|
||||
</foreach>
|
||||
</delete>
|
||||
<update id="removeIItemByItemId" parameterType="Long">
|
||||
update i_item set del_flag='1' where item_id = #{itemId}
|
||||
</update>
|
||||
|
||||
<update id="removeIItemByItemIds" parameterType="String">
|
||||
update i_item set del_flag='1' where item_id in
|
||||
<foreach item="itemId" collection="array" open="(" separator="," close=")">
|
||||
#{itemId}
|
||||
</foreach>
|
||||
</update>
|
||||
<update id="truncateItem" >
|
||||
TRUNCATE TABLE i_item
|
||||
</update>
|
||||
|
||||
|
||||
<select id="selectIItemByItemCode" parameterType="String" resultMap="IItemResult">
|
||||
<include refid="selectIItemVo"/>
|
||||
where a.item_code = #{itemCode}
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,117 @@
|
||||
<?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.intc.invest.mapper.ILogMapper">
|
||||
|
||||
<resultMap type="ILogVo" id="ILogResult">
|
||||
<result property="logId" column="log_id" />
|
||||
<result property="mobile" column="mobile" />
|
||||
<result property="logContent" column="log_content" />
|
||||
<result property="status" column="status" />
|
||||
<result property="operTime" column="oper_time" />
|
||||
<result property="createUser" column="create_user" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="type" column="type" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="itemCodeName" column="item_code_name" />
|
||||
<result property="logDetail" column="log_detail" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectILogVo">
|
||||
select a.log_id, a.mobile,a.item_code_name,a.log_detail, a.log_content, a.status, a.oper_time, a.create_user, a.create_by, a.type, a.create_time from i_log a
|
||||
</sql>
|
||||
|
||||
<select id="selectILogList" parameterType="ILogDto" resultMap="ILogResult">
|
||||
<include refid="selectILogVo"/>
|
||||
<where>
|
||||
a.del_flag='0'
|
||||
<if test="mobile != null and mobile != ''"> and a.mobile like '%'|| #{mobile}||'%'</if>
|
||||
<if test="logContent != null and logContent != ''"> and a.log_content like '%'|| #{logContent}||'%'</if>
|
||||
<if test="status != null and status != ''"> and a.status = #{status}</if>
|
||||
<if test="type != null and type != ''"> and a.type = #{type}</if>
|
||||
<if test="operTime != null "> and a.oper_time = #{operTime}</if>
|
||||
</where>
|
||||
<!-- 数据范围过滤 -->
|
||||
${params.dataScope}
|
||||
order by a.oper_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectILogByLogId" parameterType="Long" resultMap="ILogResult">
|
||||
<include refid="selectILogVo"/>
|
||||
where a.log_id = #{logId}
|
||||
</select>
|
||||
|
||||
<insert id="insertILog" parameterType="ILog">
|
||||
insert into i_log
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="logId != null">log_id,</if>
|
||||
<if test="mobile != null">mobile,</if>
|
||||
<if test="logContent != null">log_content,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="operTime != null">oper_time,</if>
|
||||
<if test="createUser != null">create_user,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="type != null">type,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="logDetail != null">log_detail,</if>
|
||||
<if test="itemCodeName != null">item_code_name,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="logId != null">#{logId},</if>
|
||||
<if test="mobile != null">#{mobile},</if>
|
||||
<if test="logContent != null">#{logContent},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="operTime != null">#{operTime},</if>
|
||||
<if test="createUser != null">#{createUser},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="type != null">#{type},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="logDetail != null">#{logDetail},</if>
|
||||
<if test="itemCodeName != null">#{itemCodeName},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateILog" parameterType="ILog">
|
||||
update i_log
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="mobile != null">mobile = #{mobile},</if>
|
||||
<if test="logContent != null">log_content = #{logContent},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="operTime != null">oper_time = #{operTime},</if>
|
||||
<if test="createUser != null">create_user = #{createUser},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="type != null">type = #{type},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="logDetail != null">log_detail = #{logDetail},</if>
|
||||
<if test="itemCodeName != null">item_code_name = #{itemCodeName},</if>
|
||||
</trim>
|
||||
where log_id = #{logId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteILogByLogId" parameterType="Long">
|
||||
delete from i_log where log_id = #{logId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteILogByLogIds" parameterType="String">
|
||||
delete from i_log where log_id in
|
||||
<foreach item="logId" collection="array" open="(" separator="," close=")">
|
||||
#{logId}
|
||||
</foreach>
|
||||
</delete>
|
||||
<update id="removeILogByLogId" parameterType="Long">
|
||||
update i_log set del_flag='1' where log_id = #{logId}
|
||||
</update>
|
||||
|
||||
<update id="removeILogByLogIds" parameterType="String">
|
||||
update i_log set del_flag='1' where log_id in
|
||||
<foreach item="logId" collection="array" open="(" separator="," close=")">
|
||||
#{logId}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<update id="cleanLog" >
|
||||
TRUNCATE TABLE i_log
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,235 @@
|
||||
<?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.intc.invest.mapper.IShopMapper">
|
||||
|
||||
<resultMap type="IShopVo" id="IShopResult">
|
||||
<result property="shopId" column="shop_id" />
|
||||
<result property="iShopId" column="i_shop_id" />
|
||||
<result property="provinceName" column="province_name" />
|
||||
<result property="cityName" column="city_name" />
|
||||
<result property="districtName" column="district_name" />
|
||||
<result property="fullAddress" column="full_address" />
|
||||
<result property="lat" column="lat" />
|
||||
<result property="lng" column="lng" />
|
||||
<result property="name" column="name" />
|
||||
<result property="tenantName" column="tenant_name" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="openStartTime" column="open_start_time" />
|
||||
<result property="openEndTime" column="open_end_time" />
|
||||
<result property="address" column="address" />
|
||||
<result property="city" column="city" />
|
||||
<result property="district" column="district" />
|
||||
<result property="province" column="province" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectIShopVo">
|
||||
select a.shop_id, a.i_shop_id, a.open_start_time, a.open_end_time, a.address, a.city, a.district, a.province, a.province_name, a.city_name, a.district_name, a.full_address, a.lat, a.lng, a.name, a.tenant_name, a.create_time from i_shop a
|
||||
</sql>
|
||||
|
||||
<select id="selectIShopList" parameterType="IShopDto" resultMap="IShopResult">
|
||||
<include refid="selectIShopVo"/>
|
||||
<where>
|
||||
a.del_flag='0'
|
||||
<if test="iShopId != null and iShopId != ''"> and a.i_shop_id = #{iShopId}</if>
|
||||
<if test="address != null and address != ''"> and a.address like '%'|| #{address}||'%'</if>
|
||||
<if test="city != null and city != ''"> and a.city = #{city}</if>
|
||||
<if test="district != null and district != ''"> and a.district = #{district}</if>
|
||||
<if test="province != null and province != ''"> and a.province = #{province}</if>
|
||||
<if test="provinceName != null and provinceName != ''"> and a.province_name like '%'|| #{provinceName}||'%'</if>
|
||||
<if test="cityName != null and cityName != ''"> and a.city_name like '%'|| #{cityName}||'%'</if>
|
||||
<if test="districtName != null and districtName != ''"> and a.district_name like '%'|| #{districtName}||'%'</if>
|
||||
<if test="tenantName != null and tenantName != ''"> and a.tenant_name like '%'|| #{tenantName}||'%'</if>
|
||||
<if test="name != null and name != ''"> and a.name like '%'|| #{name}||'%'</if>
|
||||
</where>
|
||||
order by a.create_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectIShopByShopId" parameterType="String" resultMap="IShopResult">
|
||||
<include refid="selectIShopVo"/>
|
||||
where a.shop_id = #{shopId}
|
||||
</select>
|
||||
|
||||
<insert id="insertIShop" parameterType="IShop">
|
||||
insert into i_shop
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="shopId != null">shop_id,</if>
|
||||
<if test="iShopId != null">i_shop_id,</if>
|
||||
<if test="provinceName != null">province_name,</if>
|
||||
<if test="cityName != null">city_name,</if>
|
||||
<if test="districtName != null">district_name,</if>
|
||||
<if test="fullAddress != null">full_address,</if>
|
||||
<if test="lat != null">lat,</if>
|
||||
<if test="lng != null">lng,</if>
|
||||
<if test="name != null">name,</if>
|
||||
<if test="tenantName != null">tenant_name,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="openStartTime != null">open_start_time,</if>
|
||||
<if test="openEndTime != null">open_end_time,</if>
|
||||
<if test="address != null">address,</if>
|
||||
<if test="city != null">city,</if>
|
||||
<if test="district != null">district,</if>
|
||||
<if test="province != null">province,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="shopId != null">#{shopId},</if>
|
||||
<if test="iShopId != null">#{iShopId},</if>
|
||||
<if test="provinceName != null">#{provinceName},</if>
|
||||
<if test="cityName != null">#{cityName},</if>
|
||||
<if test="districtName != null">#{districtName},</if>
|
||||
<if test="fullAddress != null">#{fullAddress},</if>
|
||||
<if test="lat != null">#{lat},</if>
|
||||
<if test="lng != null">#{lng},</if>
|
||||
<if test="name != null">#{name},</if>
|
||||
<if test="tenantName != null">#{tenantName},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="openStartTime != null">#{openStartTime},</if>
|
||||
<if test="openEndTime != null">#{openEndTime},</if>
|
||||
<if test="address != null">#{address},</if>
|
||||
<if test="city != null">#{city},</if>
|
||||
<if test="district != null">#{district},</if>
|
||||
<if test="province != null">#{province},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateIShop" parameterType="IShop">
|
||||
update i_shop
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="iShopId != null">i_shop_id = #{iShopId},</if>
|
||||
<if test="provinceName != null">province_name = #{provinceName},</if>
|
||||
<if test="cityName != null">city_name = #{cityName},</if>
|
||||
<if test="districtName != null">district_name = #{districtName},</if>
|
||||
<if test="fullAddress != null">full_address = #{fullAddress},</if>
|
||||
<if test="lat != null">lat = #{lat},</if>
|
||||
<if test="lng != null">lng = #{lng},</if>
|
||||
<if test="name != null">name = #{name},</if>
|
||||
<if test="tenantName != null">tenant_name = #{tenantName},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="openStartTime != null">open_start_time = #{openStartTime},</if>
|
||||
<if test="openEndTime != null">open_end_time = #{openEndTime},</if>
|
||||
<if test="address != null">address = #{address},</if>
|
||||
<if test="city != null">city = #{city},</if>
|
||||
<if test="district != null">district = #{district},</if>
|
||||
<if test="province != null">province = #{province},</if>
|
||||
</trim>
|
||||
where shop_id = #{shopId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteIShopByShopId" parameterType="String">
|
||||
delete from i_shop where shop_id = #{shopId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteIShopByShopIds" parameterType="String">
|
||||
delete from i_shop where shop_id in
|
||||
<foreach item="shopId" collection="array" open="(" separator="," close=")">
|
||||
#{shopId}
|
||||
</foreach>
|
||||
</delete>
|
||||
<update id="removeIShopByShopId" parameterType="String">
|
||||
update i_shop set del_flag='1' where shop_id = #{shopId}
|
||||
</update>
|
||||
|
||||
<update id="removeIShopByShopIds" parameterType="String">
|
||||
update i_shop set del_flag='1' where shop_id in
|
||||
<foreach item="shopId" collection="array" open="(" separator="," close=")">
|
||||
#{shopId}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<update id="truncateShop" >
|
||||
TRUNCATE TABLE i_shop
|
||||
</update>
|
||||
|
||||
<insert id="batchInsertIShop">
|
||||
insert into i_shop(shop_id, i_shop_id, province_name, city_name, district_name, full_address, lat, lng, name, tenant_name, create_time, open_end_time, open_start_time, address, city, district, province) values
|
||||
<foreach item="item" index="index" collection="list" separator=",">
|
||||
(#{item.shopId},
|
||||
#{item.iShopId},
|
||||
#{item.provinceName},
|
||||
#{item.cityName},
|
||||
#{item.districtName},
|
||||
#{item.fullAddress},
|
||||
#{item.lat},
|
||||
#{item.lng},
|
||||
#{item.name},
|
||||
#{item.tenantName},
|
||||
#{item.createTime},
|
||||
#{item.openEndTime},
|
||||
#{item.openStartTime},
|
||||
#{item.address},
|
||||
#{item.city},
|
||||
#{item.district},
|
||||
#{item.province})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<select id="selectIShopByIShopId" parameterType="String" resultMap="IShopResult">
|
||||
<include refid="selectIShopVo"/>
|
||||
where a.i_shop_id = #{iShopId}
|
||||
</select>
|
||||
|
||||
<select id="selectProvinceVoList" parameterType="IShopDto" resultType="com.intc.invest.domain.vo.IProvinceVo">
|
||||
select
|
||||
distinct
|
||||
a.province_name as provinceName
|
||||
from
|
||||
i_shop a
|
||||
<where>
|
||||
a.province_name != ''
|
||||
and a.province_name is not null
|
||||
<if test="city != null and city != ''"> and a.city = #{city}</if>
|
||||
<if test="district != null and district != ''"> and a.district = #{district}</if>
|
||||
<if test="cityName != null and cityName != ''"> and a.city_name like '%'|| #{cityName}||'%'</if>
|
||||
<if test="districtName != null and districtName != ''"> and a.district_name like '%'|| #{districtName}||'%'</if>
|
||||
|
||||
</where>
|
||||
order by a.province_name desc
|
||||
</select>
|
||||
|
||||
<select id="selectCityVoList" parameterType="IShopDto" resultType="com.intc.invest.domain.vo.ICityVo">
|
||||
select
|
||||
distinct
|
||||
a.city_name as cityName
|
||||
from
|
||||
i_shop a
|
||||
<where>
|
||||
a.province_name != ''
|
||||
and a.province_name is not null
|
||||
and a.city_name != ''
|
||||
and a.city_name is not null
|
||||
<if test="province != null and province != ''"> and a.province = #{province}</if>
|
||||
<if test="provinceName != null and provinceName != ''"> and a.province_name like '%'|| #{provinceName}||'%'</if>
|
||||
<if test="city != null and city != ''"> and a.city = #{city}</if>
|
||||
<if test="district != null and district != ''"> and a.district = #{district}</if>
|
||||
<if test="cityName != null and cityName != ''"> and a.city_name like '%'|| #{cityName}||'%'</if>
|
||||
<if test="districtName != null and districtName != ''"> and a.district_name like '%'|| #{districtName}||'%'</if>
|
||||
|
||||
</where>
|
||||
order by a.city_name desc
|
||||
</select>
|
||||
|
||||
<select id="selectDistrictVoList" parameterType="IShopDto" resultType="com.intc.invest.domain.vo.IDistrictVo">
|
||||
select
|
||||
distinct
|
||||
a.district_name as districtName
|
||||
from
|
||||
i_shop a
|
||||
<where>
|
||||
a.province_name != ''
|
||||
and a.province_name is not null
|
||||
and a.city_name != ''
|
||||
and a.city_name is not null
|
||||
and a.district_name != ''
|
||||
and a.district_name is not null
|
||||
<if test="province != null and province != ''"> and a.province = #{province}</if>
|
||||
<if test="provinceName != null and provinceName != ''"> and a.province_name like '%'|| #{provinceName}||'%'</if>
|
||||
<if test="city != null and city != ''"> and a.city = #{city}</if>
|
||||
<if test="district != null and district != ''"> and a.district = #{district}</if>
|
||||
<if test="cityName != null and cityName != ''"> and a.city_name like '%'|| #{cityName}||'%'</if>
|
||||
<if test="districtName != null and districtName != ''"> and a.district_name like '%'|| #{districtName}||'%'</if>
|
||||
|
||||
</where>
|
||||
order by a.district_name desc
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,291 @@
|
||||
<?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.intc.invest.mapper.IUserMapper">
|
||||
|
||||
<resultMap type="IUserVo" id="IUserResult">
|
||||
<result property="mobile" column="mobile" />
|
||||
<result property="userId" column="user_id" />
|
||||
<result property="token" column="token" />
|
||||
<result property="cookie" column="cookie" />
|
||||
<result property="deviceId" column="device_id" />
|
||||
<result property="itemCode" column="item_code" />
|
||||
<result property="ishopId" column="ishop_id" />
|
||||
<result property="provinceName" column="province_name" />
|
||||
<result property="cityName" column="city_name" />
|
||||
<result property="address" column="address" />
|
||||
<result property="lat" column="lat" />
|
||||
<result property="lng" column="lng" />
|
||||
<result property="minute" column="minute" />
|
||||
<result property="shopType" column="shop_type" />
|
||||
<result property="randomMinute" column="random_minute" />
|
||||
<result property="pushPlusToken" column="push_plus_token" />
|
||||
<result property="jsonResult" column="json_result" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="expireTime" column="expire_time" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="createUser" column="create_user" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="updateUser" column="update_user" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="districtName" column="district_name" />
|
||||
<result property="userName" column="user_name" />
|
||||
<result property="itemName" column="item_name" />
|
||||
<result property="shopName" column="shop_name" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectIUserVo">
|
||||
select
|
||||
a.mobile,
|
||||
a.user_id,
|
||||
a.district_name,
|
||||
a.user_name,
|
||||
a.item_name,
|
||||
a.token,
|
||||
a.cookie,
|
||||
a.device_id,
|
||||
a.item_code,
|
||||
a.ishop_id,
|
||||
a.province_name,
|
||||
a.city_name,
|
||||
a.address,
|
||||
a.lat,
|
||||
a.lng,
|
||||
a.minute,
|
||||
a.shop_type,
|
||||
a.random_minute,
|
||||
a.push_plus_token,
|
||||
a.json_result,
|
||||
a.remark,
|
||||
a.expire_time,
|
||||
a.del_flag,
|
||||
a.create_time,
|
||||
a.create_user,
|
||||
a.update_time,
|
||||
a.update_user,
|
||||
a.create_by,
|
||||
is2."name" as shop_name
|
||||
from
|
||||
i_user a
|
||||
left join i_shop is2 on is2.i_shop_id =a.ishop_id
|
||||
|
||||
</sql>
|
||||
|
||||
<select id="selectIUserList" parameterType="IUserDto" resultMap="IUserResult">
|
||||
<include refid="selectIUserVo"/>
|
||||
<where>
|
||||
a.del_flag='0'
|
||||
<if test="mobile != null and mobile != ''"> and a.mobile like '%'|| #{mobile}||'%'</if>
|
||||
<if test="token != null and token != ''"> and a.token = #{token}</if>
|
||||
<if test="cookie != null and cookie != ''"> and a.cookie = #{cookie}</if>
|
||||
<if test="deviceId != null and deviceId != ''"> and a.device_id = #{deviceId}</if>
|
||||
<if test="itemCode != null and itemCode != ''"> and a.item_code = #{itemCode}</if>
|
||||
<if test="ishopId != null and ishopId != ''"> and a.ishop_id = #{ishopId}</if>
|
||||
<if test="provinceName != null and provinceName != ''"> and a.province_name like '%'|| #{provinceName}||'%'</if>
|
||||
<if test="cityName != null and cityName != ''"> and a.city_name like '%'|| #{cityName}||'%'</if>
|
||||
<if test="address != null and address != ''"> and a.address = #{address}</if>
|
||||
<if test="lat != null and lat != ''"> and a.lat = #{lat}</if>
|
||||
<if test="lng != null and lng != ''"> and a.lng = #{lng}</if>
|
||||
<if test="minute != null "> and a.minute = #{minute}</if>
|
||||
<if test="shopType != null "> and a.shop_type = #{shopType}</if>
|
||||
<if test="randomMinute != null and randomMinute != ''"> and a.random_minute = #{randomMinute}</if>
|
||||
<if test="pushPlusToken != null and pushPlusToken != ''"> and a.push_plus_token = #{pushPlusToken}</if>
|
||||
<if test="jsonResult != null and jsonResult != ''"> and a.json_result = #{jsonResult}</if>
|
||||
<if test="expireTime != null "> and a.expire_time = #{expireTime}</if>
|
||||
<if test="createUser != null and createUser != ''"> and a.create_user = #{createUser}</if>
|
||||
<if test="updateUser != null and updateUser != ''"> and a.update_user = #{updateUser}</if>
|
||||
</where>
|
||||
<!-- 数据范围过滤 -->
|
||||
${params.dataScope}
|
||||
order by a.create_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectIUserByMobile" parameterType="String" resultMap="IUserResult">
|
||||
<include refid="selectIUserVo"/>
|
||||
where a.mobile = #{mobile}
|
||||
</select>
|
||||
|
||||
<insert id="insertIUser" parameterType="IUser">
|
||||
insert into i_user
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="mobile != null">mobile,</if>
|
||||
<if test="userId != null">user_id,</if>
|
||||
<if test="token != null and token != ''">token,</if>
|
||||
<if test="cookie != null and cookie != ''">cookie,</if>
|
||||
<if test="deviceId != null">device_id,</if>
|
||||
<if test="itemCode != null and itemCode != ''">item_code,</if>
|
||||
<if test="ishopId != null">ishop_id,</if>
|
||||
<if test="provinceName != null">province_name,</if>
|
||||
<if test="cityName != null">city_name,</if>
|
||||
<if test="address != null">address,</if>
|
||||
<if test="lat != null">lat,</if>
|
||||
<if test="lng != null">lng,</if>
|
||||
<if test="minute != null">minute,</if>
|
||||
<if test="shopType != null">shop_type,</if>
|
||||
<if test="randomMinute != null">random_minute,</if>
|
||||
<if test="pushPlusToken != null">push_plus_token,</if>
|
||||
<if test="jsonResult != null">json_result,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="expireTime != null">expire_time,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="createUser != null">create_user,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="updateUser != null">update_user,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="districtName != null">district_name,</if>
|
||||
<if test="userName != null">user_name,</if>
|
||||
<if test="itemName != null">item_name,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="mobile != null">#{mobile},</if>
|
||||
<if test="userId != null">#{userId},</if>
|
||||
<if test="token != null and token != ''">#{token},</if>
|
||||
<if test="cookie != null and cookie != ''">#{cookie},</if>
|
||||
<if test="deviceId != null">#{deviceId},</if>
|
||||
<if test="itemCode != null and itemCode != ''">#{itemCode},</if>
|
||||
<if test="ishopId != null">#{ishopId},</if>
|
||||
<if test="provinceName != null">#{provinceName},</if>
|
||||
<if test="cityName != null">#{cityName},</if>
|
||||
<if test="address != null">#{address},</if>
|
||||
<if test="lat != null">#{lat},</if>
|
||||
<if test="lng != null">#{lng},</if>
|
||||
<if test="minute != null">#{minute},</if>
|
||||
<if test="shopType != null">#{shopType},</if>
|
||||
<if test="randomMinute != null">#{randomMinute},</if>
|
||||
<if test="pushPlusToken != null">#{pushPlusToken},</if>
|
||||
<if test="jsonResult != null">#{jsonResult},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="expireTime != null">#{expireTime},</if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="createUser != null">#{createUser},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="updateUser != null">#{updateUser},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="districtName != null">#{districtName},</if>
|
||||
<if test="userName != null">#{userName},</if>
|
||||
<if test="itemName != null">#{itemName},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateIUser" parameterType="IUser">
|
||||
update i_user
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="userId != null">user_id = #{userId},</if>
|
||||
<if test="token != null and token != ''">token = #{token},</if>
|
||||
<if test="cookie != null and cookie != ''">cookie = #{cookie},</if>
|
||||
<if test="deviceId != null">device_id = #{deviceId},</if>
|
||||
<if test="itemCode != null and itemCode != ''">item_code = #{itemCode},</if>
|
||||
<if test="ishopId != null">ishop_id = #{ishopId},</if>
|
||||
<if test="provinceName != null">province_name = #{provinceName},</if>
|
||||
<if test="cityName != null">city_name = #{cityName},</if>
|
||||
<if test="address != null">address = #{address},</if>
|
||||
<if test="lat != null">lat = #{lat},</if>
|
||||
<if test="lng != null">lng = #{lng},</if>
|
||||
<if test="minute != null">minute = #{minute},</if>
|
||||
<if test="shopType != null">shop_type = #{shopType},</if>
|
||||
<if test="randomMinute != null">random_minute = #{randomMinute},</if>
|
||||
<if test="pushPlusToken != null">push_plus_token = #{pushPlusToken},</if>
|
||||
<if test="jsonResult != null">json_result = #{jsonResult},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="expireTime != null">expire_time = #{expireTime},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="createUser != null">create_user = #{createUser},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="updateUser != null">update_user = #{updateUser},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="districtName != null">district_name = #{districtName},</if>
|
||||
<if test="userName != null">user_name = #{userName},</if>
|
||||
<if test="itemName != null">item_name = #{itemName},</if>
|
||||
</trim>
|
||||
where mobile = #{mobile}
|
||||
</update>
|
||||
|
||||
<delete id="deleteIUserByMobile" parameterType="Long">
|
||||
delete from i_user where mobile = #{mobile}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteIUserByMobiles" parameterType="String">
|
||||
delete from i_user where mobile in
|
||||
<foreach item="mobile" collection="array" open="(" separator="," close=")">
|
||||
#{mobile}
|
||||
</foreach>
|
||||
</delete>
|
||||
<update id="removeIUserByMobile" parameterType="Long">
|
||||
update i_user set del_flag='1' where mobile = #{mobile}
|
||||
</update>
|
||||
|
||||
<update id="removeIUserByMobiles" parameterType="String">
|
||||
update i_user set del_flag='1' where mobile in
|
||||
<foreach item="mobile" collection="array" open="(" separator="," close=")">
|
||||
#{mobile}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<update id="batchUpdateMinute">
|
||||
<foreach collection="list" item="item" separator=";">
|
||||
update i_user
|
||||
<set >
|
||||
<if test="item.minute != null">minute = #{item.minute},</if>
|
||||
</set>
|
||||
<where>
|
||||
mobile = #{item.mobile}
|
||||
</where>
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<select id="selectReservationUserByMinute" parameterType="IUserDto" resultMap="IUserResult">
|
||||
<include refid="selectIUserVo"/>
|
||||
<where>
|
||||
a.del_flag='0'
|
||||
and a.lat !=''
|
||||
and a.lng!=''
|
||||
and a.item_code!=''
|
||||
<if test="minute != null "> and a.minute = #{minute}</if>
|
||||
|
||||
</where>
|
||||
order by a.create_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectReservationUser" resultMap="IUserResult">
|
||||
<include refid="selectIUserVo"/>
|
||||
<where>
|
||||
a.del_flag='0'
|
||||
and a.lat !=''
|
||||
and a.lng!=''
|
||||
and a.item_code!=''
|
||||
</where>
|
||||
order by a.create_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectAllIUserList" parameterType="IUserDto" resultMap="IUserResult">
|
||||
<include refid="selectIUserVo"/>
|
||||
<where>
|
||||
a.del_flag='0'
|
||||
<if test="mobile != null and mobile != ''"> and a.mobile like '%'|| #{mobile}||'%'</if>
|
||||
<if test="token != null and token != ''"> and a.token = #{token}</if>
|
||||
<if test="cookie != null and cookie != ''"> and a.cookie = #{cookie}</if>
|
||||
<if test="deviceId != null and deviceId != ''"> and a.device_id = #{deviceId}</if>
|
||||
<if test="itemCode != null and itemCode != ''"> and a.item_code = #{itemCode}</if>
|
||||
<if test="ishopId != null and ishopId != ''"> and a.ishop_id = #{ishopId}</if>
|
||||
<if test="provinceName != null and provinceName != ''"> and a.province_name like '%'|| #{provinceName}||'%'</if>
|
||||
<if test="cityName != null and cityName != ''"> and a.city_name like '%'|| #{cityName}||'%'</if>
|
||||
<if test="address != null and address != ''"> and a.address = #{address}</if>
|
||||
<if test="lat != null and lat != ''"> and a.lat = #{lat}</if>
|
||||
<if test="lng != null and lng != ''"> and a.lng = #{lng}</if>
|
||||
<if test="minute != null "> and a.minute = #{minute}</if>
|
||||
<if test="shopType != null "> and a.shop_type = #{shopType}</if>
|
||||
<if test="randomMinute != null and randomMinute != ''"> and a.random_minute = #{randomMinute}</if>
|
||||
<if test="pushPlusToken != null and pushPlusToken != ''"> and a.push_plus_token = #{pushPlusToken}</if>
|
||||
<if test="jsonResult != null and jsonResult != ''"> and a.json_result = #{jsonResult}</if>
|
||||
<if test="expireTime != null "> and a.expire_time = #{expireTime}</if>
|
||||
<if test="createUser != null and createUser != ''"> and a.create_user = #{createUser}</if>
|
||||
<if test="updateUser != null and updateUser != ''"> and a.update_user = #{updateUser}</if>
|
||||
</where>
|
||||
order by a.create_time desc
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,174 @@
|
||||
<?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.intc.invest.mapper.InstallmentHistoryDetailMapper">
|
||||
|
||||
<resultMap type="InstallmentHistoryDetailVo" id="InstallmentHistoryDetailResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="installmentHistoryId" column="installment_history_id" />
|
||||
<result property="bankCardLendId" column="bank_card_lend_id" />
|
||||
<result property="currentAmount" column="current_amount" />
|
||||
<result property="repaymentDate" column="repayment_date" />
|
||||
<result property="principal" column="principal" />
|
||||
<result property="interest" column="interest" />
|
||||
<result property="postingState" column="posting_state" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="type" column="type" />
|
||||
<result property="periods" column="periods" />
|
||||
<result property="bankCardLendName" column="bank_card_lend_name" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectInstallmentHistoryDetailVo">
|
||||
select
|
||||
a.id,
|
||||
a.installment_history_id,
|
||||
a.bank_card_lend_id,
|
||||
a.current_amount,
|
||||
a.repayment_date,
|
||||
a.principal,
|
||||
a.interest,
|
||||
a.posting_state,
|
||||
a.create_by,
|
||||
a.create_time,
|
||||
a.update_by,
|
||||
a.update_time,
|
||||
a.del_flag,
|
||||
a.remark,
|
||||
a.type,
|
||||
a.periods,
|
||||
CONCAT(bcl."name",
|
||||
'(',
|
||||
right(bcl.code,
|
||||
4),
|
||||
')') as bank_card_lend_name
|
||||
from
|
||||
installment_history_detail a
|
||||
left join bank_card_lend bcl on
|
||||
bcl.id = a.bank_card_lend_id
|
||||
left join installment_history ih on ih.id=a.installment_history_id
|
||||
</sql>
|
||||
|
||||
<select id="selectInstallmentHistoryDetailList" parameterType="InstallmentHistoryDetailDto" resultMap="InstallmentHistoryDetailResult">
|
||||
<include refid="selectInstallmentHistoryDetailVo"/>
|
||||
<where>
|
||||
a.del_flag='0' and ih.del_flag='0'
|
||||
<if test="installmentHistoryId != null "> and a.installment_history_id = #{installmentHistoryId}</if>
|
||||
<if test="bankCardLendId != null "> and a.bank_card_lend_id = #{bankCardLendId}</if>
|
||||
<if test="type != null and type != ''"> and a.type = #{type}</if>
|
||||
<if test="periods != null "> and a.periods = #{periods}</if>
|
||||
<if test="state != null and state != ''"> and a.posting_state = #{state}</if>
|
||||
<if test="repaymentMonth!=null and repaymentMonth !=''">
|
||||
and #{repaymentMonth}=to_char(a.repayment_date, 'yyyy-MM')
|
||||
</if>
|
||||
<if test="repaymentDate!=null and repaymentDate !=''">
|
||||
and #{repaymentDate}>=to_char(a.repayment_date, 'yyyy-MM-dd')
|
||||
</if>
|
||||
<if test="repaymentEqualDate!=null and repaymentEqualDate !=''">
|
||||
and #{repaymentEqualDate}=to_char(a.repayment_date, 'yyyy-MM-dd')
|
||||
</if>
|
||||
<if test="startDate!=null and startDate !=''">
|
||||
and to_char(a.repayment_date, 'yyyy-MM-dd')>=#{startDate}
|
||||
</if>
|
||||
<if test="endDate!=null and endDate !=''">
|
||||
and #{endDate}>=to_char(a.repayment_date, 'yyyy-MM-dd')
|
||||
</if>
|
||||
</where>
|
||||
<!-- 数据范围过滤 -->
|
||||
${params.dataScope}
|
||||
order by a.repayment_date desc
|
||||
</select>
|
||||
|
||||
<select id="selectInstallmentHistoryDetailById" parameterType="Long" resultMap="InstallmentHistoryDetailResult">
|
||||
<include refid="selectInstallmentHistoryDetailVo"/>
|
||||
where a.id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertInstallmentHistoryDetail" parameterType="InstallmentHistoryDetail">
|
||||
insert into installment_history_detail
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</if>
|
||||
<if test="installmentHistoryId != null">installment_history_id,</if>
|
||||
<if test="bankCardLendId != null">bank_card_lend_id,</if>
|
||||
<if test="currentAmount != null and currentAmount != ''">current_amount,</if>
|
||||
<if test="repaymentDate != null">repayment_date,</if>
|
||||
<if test="principal != null">principal,</if>
|
||||
<if test="interest != null">interest,</if>
|
||||
<if test="postingState != null and postingState != ''">posting_state,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="type != null">type,</if>
|
||||
<if test="periods != null">periods,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
<if test="installmentHistoryId != null">#{installmentHistoryId},</if>
|
||||
<if test="bankCardLendId != null">#{bankCardLendId},</if>
|
||||
<if test="currentAmount != null and currentAmount != ''">#{currentAmount},</if>
|
||||
<if test="repaymentDate != null">#{repaymentDate},</if>
|
||||
<if test="principal != null">#{principal},</if>
|
||||
<if test="interest != null">#{interest},</if>
|
||||
<if test="postingState != null and postingState != ''">#{postingState},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="type != null">#{type},</if>
|
||||
<if test="periods != null">#{periods},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateInstallmentHistoryDetail" parameterType="InstallmentHistoryDetail">
|
||||
update installment_history_detail
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="installmentHistoryId != null">installment_history_id = #{installmentHistoryId},</if>
|
||||
<if test="bankCardLendId != null">bank_card_lend_id = #{bankCardLendId},</if>
|
||||
<if test="currentAmount != null and currentAmount != ''">current_amount = #{currentAmount},</if>
|
||||
<if test="repaymentDate != null">repayment_date = #{repaymentDate},</if>
|
||||
<if test="principal != null">principal = #{principal},</if>
|
||||
<if test="interest != null">interest = #{interest},</if>
|
||||
<if test="postingState != null and postingState != ''">posting_state = #{postingState},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="type != null">type = #{type},</if>
|
||||
<if test="periods != null">periods = #{periods},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteInstallmentHistoryDetailById" parameterType="Long">
|
||||
delete from installment_history_detail where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteInstallmentHistoryDetailByIds" parameterType="String">
|
||||
delete from installment_history_detail where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
<update id="removeInstallmentHistoryDetailById" parameterType="Long">
|
||||
update installment_history_detail set del_flag='1' where id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="removeInstallmentHistoryDetailByIds" parameterType="String">
|
||||
update installment_history_detail set del_flag='1' where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</update>
|
||||
</mapper>
|
||||
@@ -0,0 +1,260 @@
|
||||
<?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.intc.invest.mapper.InstallmentHistoryMapper">
|
||||
|
||||
<resultMap type="InstallmentHistoryVo" id="InstallmentHistoryResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="name" column="name" />
|
||||
<result property="type" column="type" />
|
||||
<result property="code" column="code" />
|
||||
<result property="bankCardLendId" column="bank_card_lend_id" />
|
||||
<result property="installmentAmount" column="installment_amount" />
|
||||
<result property="installmentDate" column="installment_date" />
|
||||
<result property="period" column="period" />
|
||||
<result property="repaidPeriod" column="repaid_period" />
|
||||
<result property="totalInterest" column="total_interest" />
|
||||
<result property="interestRate" column="interest_rate" />
|
||||
<result property="dueDate" column="due_date" />
|
||||
<result property="closeDate" column="close_date" />
|
||||
<result property="state" column="state" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="balance" column="balance" />
|
||||
<result property="bankName" column="bank_name" />
|
||||
<result property="bankCode" column="bank_code" />
|
||||
<result property="receivingAccountName" column="receiving_account_name" />
|
||||
<result property="receivingAccountCode" column="receiving_account_code" />
|
||||
<result property="repaymentDate" column="repayment_date" />
|
||||
<result property="calculateInterestRate" column="calculate_interest_rate" />
|
||||
<result property="outstandingInterest" column="outstanding_interest" />
|
||||
<result property="outstandingPrincipal" column="outstanding_principal" />
|
||||
<result property="receivingAccountId" column="receiving_account_id" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectInstallmentHistoryVo">
|
||||
select
|
||||
a.id,
|
||||
a.name,
|
||||
a.type,
|
||||
a.code,
|
||||
a.bank_card_lend_id,
|
||||
a.installment_amount,
|
||||
a.installment_date,
|
||||
a.period,
|
||||
a.receiving_account_id,
|
||||
a.calculate_interest_rate,
|
||||
(
|
||||
select
|
||||
CASE
|
||||
WHEN sum(ihd.current_amount) is null THEN 0
|
||||
ELSE sum(ihd.current_amount)
|
||||
END
|
||||
from
|
||||
installment_history_detail ihd
|
||||
where
|
||||
ihd.installment_history_id = a.id
|
||||
and ihd.posting_state = '0'
|
||||
and ihd.del_flag='0'
|
||||
) as balance,
|
||||
(
|
||||
select
|
||||
CASE
|
||||
WHEN sum(ihd.interest) is null THEN 0
|
||||
ELSE sum(ihd.interest)
|
||||
END
|
||||
from
|
||||
installment_history_detail ihd
|
||||
where
|
||||
ihd.installment_history_id = a.id
|
||||
and ihd.posting_state = '0'
|
||||
and ihd.del_flag='0'
|
||||
) as outstanding_interest,
|
||||
(
|
||||
select
|
||||
CASE
|
||||
WHEN sum(ihd.principal) is null THEN 0
|
||||
ELSE sum(ihd.principal)
|
||||
END
|
||||
from
|
||||
installment_history_detail ihd
|
||||
where
|
||||
ihd.installment_history_id = a.id
|
||||
and ihd.posting_state = '0'
|
||||
and ihd.del_flag='0'
|
||||
) as outstanding_principal,
|
||||
(
|
||||
select
|
||||
min(d.repayment_date)
|
||||
from
|
||||
installment_history_detail d
|
||||
where
|
||||
d.installment_history_id = a.id
|
||||
and d.posting_state = '0'
|
||||
and d.del_flag='0' )
|
||||
as repayment_date,
|
||||
a.repaid_period,
|
||||
a.total_interest,
|
||||
a.interest_rate,
|
||||
a.due_date,
|
||||
a.close_date,
|
||||
a.state,
|
||||
a.create_by,
|
||||
a.create_time,
|
||||
a.update_by,
|
||||
a.update_time,
|
||||
a.del_flag,
|
||||
a.remark,
|
||||
bc."name" as bank_name,
|
||||
bc.code as bank_code,
|
||||
debit."name" as receiving_account_name,
|
||||
debit.code as receiving_account_code
|
||||
from
|
||||
installment_history a
|
||||
left join bank_card_lend bc on
|
||||
bc.id = a.bank_card_lend_id
|
||||
left join bank_card_lend debit on
|
||||
debit.id = a.receiving_account_id
|
||||
</sql>
|
||||
|
||||
<select id="selectInstallmentHistoryList" parameterType="InstallmentHistoryDto" resultMap="InstallmentHistoryResult">
|
||||
<include refid="selectInstallmentHistoryVo"/>
|
||||
<where>
|
||||
a.del_flag='0'
|
||||
<if test="name != null and name != ''"> and a.name like '%'|| #{name}||'%'</if>
|
||||
<if test="bankCardLendId != null and bankCardLendId != ''"> and a.bank_card_lend_id = #{bankCardLendId}</if>
|
||||
<if test="state != null and state != ''"> and a.state = #{state}</if>
|
||||
<if test="type != null and type != ''"> and a.type = #{type}</if>
|
||||
<if test="startMonth!=null and startMonth !=''">
|
||||
and to_char(a.installment_date, 'yyyy-MM')>=#{startMonth}
|
||||
</if>
|
||||
<if test="endMonth!=null and endMonth !=''">
|
||||
and #{endMonth}>=to_char(a.installment_date, 'yyyy-MM')
|
||||
</if>
|
||||
</where>
|
||||
<!-- 数据范围过滤 -->
|
||||
${params.dataScope}
|
||||
order by a.installment_date desc
|
||||
</select>
|
||||
|
||||
<select id="selectInstallmentHistoryById" parameterType="Long" resultMap="InstallmentHistoryResult">
|
||||
<include refid="selectInstallmentHistoryVo"/>
|
||||
where a.id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertInstallmentHistory" parameterType="InstallmentHistory">
|
||||
insert into installment_history
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</if>
|
||||
<if test="name != null">name,</if>
|
||||
<if test="type != null">type,</if>
|
||||
<if test="code != null">code,</if>
|
||||
<if test="bankCardLendId != null and bankCardLendId != ''">bank_card_lend_id,</if>
|
||||
<if test="installmentAmount != null and installmentAmount != ''">installment_amount,</if>
|
||||
<if test="installmentDate != null">installment_date,</if>
|
||||
<if test="period != null">period,</if>
|
||||
<if test="repaidPeriod != null">repaid_period,</if>
|
||||
<if test="totalInterest != null">total_interest,</if>
|
||||
<if test="interestRate != null">interest_rate,</if>
|
||||
<if test="dueDate != null">due_date,</if>
|
||||
<if test="closeDate != null">close_date,</if>
|
||||
<if test="state != null and state != ''">state,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="balance != null">balance,</if>
|
||||
<if test="calculateInterestRate != null">calculate_interest_rate,</if>
|
||||
<if test="receivingAccountId != null">receiving_account_id,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
<if test="name != null">#{name},</if>
|
||||
<if test="type != null">#{type},</if>
|
||||
<if test="code != null">#{code},</if>
|
||||
<if test="bankCardLendId != null and bankCardLendId != ''">#{bankCardLendId},</if>
|
||||
<if test="installmentAmount != null and installmentAmount != ''">#{installmentAmount},</if>
|
||||
<if test="installmentDate != null">#{installmentDate},</if>
|
||||
<if test="period != null">#{period},</if>
|
||||
<if test="repaidPeriod != null">#{repaidPeriod},</if>
|
||||
<if test="totalInterest != null">#{totalInterest},</if>
|
||||
<if test="interestRate != null">#{interestRate},</if>
|
||||
<if test="dueDate != null">#{dueDate},</if>
|
||||
<if test="closeDate != null">#{closeDate},</if>
|
||||
<if test="state != null and state != ''">#{state},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="balance != null">#{balance},</if>
|
||||
<if test="calculateInterestRate != null">#{calculateInterestRate},</if>
|
||||
<if test="receivingAccountId != null">#{receivingAccountId},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateInstallmentHistory" parameterType="InstallmentHistory">
|
||||
update installment_history
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="name != null">name = #{name},</if>
|
||||
<if test="type != null">type = #{type},</if>
|
||||
<if test="code != null">code = #{code},</if>
|
||||
<if test="bankCardLendId != null and bankCardLendId != ''">bank_card_lend_id = #{bankCardLendId},</if>
|
||||
<if test="installmentAmount != null and installmentAmount != ''">installment_amount = #{installmentAmount},</if>
|
||||
<if test="installmentDate != null">installment_date = #{installmentDate},</if>
|
||||
<if test="period != null">period = #{period},</if>
|
||||
<if test="repaidPeriod != null">repaid_period = #{repaidPeriod},</if>
|
||||
<if test="totalInterest != null">total_interest = #{totalInterest},</if>
|
||||
<if test="interestRate != null">interest_rate = #{interestRate},</if>
|
||||
<if test="dueDate != null">due_date = #{dueDate},</if>
|
||||
<if test="closeDate != null">close_date = #{closeDate},</if>
|
||||
<if test="state != null and state != ''">state = #{state},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="balance != null">balance = #{balance},</if>
|
||||
<if test="calculateInterestRate != null">calculate_interest_rate = #{calculateInterestRate},</if>
|
||||
<if test="receivingAccountId != null">receiving_account_id = #{receivingAccountId},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteInstallmentHistoryById" parameterType="Long">
|
||||
delete from installment_history where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteInstallmentHistoryByIds" parameterType="String">
|
||||
delete from installment_history where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
<update id="removeInstallmentHistoryById" parameterType="Long">
|
||||
update installment_history set del_flag='1' where id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="removeInstallmentHistoryByIds" parameterType="String">
|
||||
update installment_history set del_flag='1' where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<delete id="deleteInstallmentHistoryDetailByIds" parameterType="String">
|
||||
delete from installment_history_detail where installment_history_id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
@@ -0,0 +1,179 @@
|
||||
<?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.intc.invest.mapper.PosMachineMapper">
|
||||
|
||||
<resultMap type="PosMachineVo" id="PosMachineResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="name" column="name" />
|
||||
<result property="type" column="type" />
|
||||
<result property="manufacture" column="manufacture" />
|
||||
<result property="payCompany" column="pay_company" />
|
||||
<result property="merchantName" column="merchant_name" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="code" column="code" />
|
||||
<result property="rate" column="rate" />
|
||||
<result property="debitCard" column="debit_card" />
|
||||
<result property="merchantType" column="merchant_type" />
|
||||
<result property="merchantCode" column="merchant_code" />
|
||||
<result property="activationDate" column="activation_date" />
|
||||
<result property="ratePlus" column="rate_plus" />
|
||||
<result property="bankName" column="bank_name" />
|
||||
<result property="bankCode" column="bank_code" />
|
||||
<result property="status" column="status" />
|
||||
<result property="roundingMode" column="rounding_mode" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectPosMachineVo">
|
||||
select
|
||||
a.id,
|
||||
a.name,
|
||||
a.type,
|
||||
a.manufacture,
|
||||
a.pay_company,
|
||||
a.merchant_name,
|
||||
a.create_by,
|
||||
a.create_time,
|
||||
a.update_by,
|
||||
a.update_time,
|
||||
a.del_flag,
|
||||
a.remark,
|
||||
a.code,
|
||||
a.rate,
|
||||
a.rate_plus,
|
||||
a.debit_card,
|
||||
a.merchant_type,
|
||||
a.merchant_code,
|
||||
a.activation_date,
|
||||
a.status,
|
||||
a.rounding_mode,
|
||||
bc."name" as bank_name,
|
||||
bc.code as bank_code
|
||||
from
|
||||
pos_machine a
|
||||
left join bank_card_lend bc on bc.id =a.debit_card
|
||||
</sql>
|
||||
|
||||
<select id="selectPosMachineList" parameterType="PosMachineDto" resultMap="PosMachineResult">
|
||||
<include refid="selectPosMachineVo"/>
|
||||
<where>
|
||||
a.del_flag='0'
|
||||
<if test="name != null and name != ''"> and a.name like '%'|| #{name}||'%'</if>
|
||||
<if test="type != null and type != ''"> and a.type = #{type}</if>
|
||||
<if test="status != null and status != ''"> and a.status = #{status}</if>
|
||||
<if test="merchantName != null and merchantName != ''"> and a.merchant_name like '%'|| #{merchantName}||'%'</if>
|
||||
</where>
|
||||
<!-- 数据范围过滤 -->
|
||||
${params.dataScope}
|
||||
order by a.create_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectPosMachineById" parameterType="Long" resultMap="PosMachineResult">
|
||||
<include refid="selectPosMachineVo"/>
|
||||
where a.id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertPosMachine" parameterType="PosMachine">
|
||||
insert into pos_machine
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</if>
|
||||
<if test="name != null">name,</if>
|
||||
<if test="type != null">type,</if>
|
||||
<if test="manufacture != null">manufacture,</if>
|
||||
<if test="payCompany != null">pay_company,</if>
|
||||
<if test="merchantName != null">merchant_name,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="code != null">code,</if>
|
||||
<if test="rate != null">rate,</if>
|
||||
<if test="ratePlus != null">rate_plus,</if>
|
||||
<if test="debitCard != null">debit_card,</if>
|
||||
<if test="merchantType != null">merchant_type,</if>
|
||||
<if test="merchantCode != null">merchant_code,</if>
|
||||
<if test="activationDate != null">activation_date,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="roundingMode != null">rounding_mode,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
<if test="name != null">#{name},</if>
|
||||
<if test="type != null">#{type},</if>
|
||||
<if test="manufacture != null">#{manufacture},</if>
|
||||
<if test="payCompany != null">#{payCompany},</if>
|
||||
<if test="merchantName != null">#{merchantName},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="code != null">#{code},</if>
|
||||
<if test="rate != null">#{rate},</if>
|
||||
<if test="ratePlus != null">#{ratePlus},</if>
|
||||
<if test="debitCard != null">#{debitCard},</if>
|
||||
<if test="merchantType != null">#{merchantType},</if>
|
||||
<if test="merchantCode != null">#{merchantCode},</if>
|
||||
<if test="activationDate != null">#{activationDate},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="roundingMode != null">#{roundingMode},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updatePosMachine" parameterType="PosMachine">
|
||||
update pos_machine
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="name != null">name = #{name},</if>
|
||||
<if test="type != null">type = #{type},</if>
|
||||
<if test="manufacture != null">manufacture = #{manufacture},</if>
|
||||
<if test="payCompany != null">pay_company = #{payCompany},</if>
|
||||
<if test="merchantName != null">merchant_name = #{merchantName},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="code != null">code = #{code},</if>
|
||||
<if test="rate != null">rate = #{rate},</if>
|
||||
<if test="ratePlus != null">rate_plus = #{ratePlus},</if>
|
||||
<if test="debitCard != null">debit_card = #{debitCard},</if>
|
||||
<if test="merchantType != null">merchant_type = #{merchantType},</if>
|
||||
<if test="merchantCode != null">merchant_code = #{merchantCode},</if>
|
||||
<if test="activationDate != null">activation_date = #{activationDate},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="roundingMode != null">rounding_mode = #{roundingMode},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deletePosMachineById" parameterType="Long">
|
||||
delete from pos_machine where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deletePosMachineByIds" parameterType="String">
|
||||
delete from pos_machine where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
<update id="removePosMachineById" parameterType="Long">
|
||||
update pos_machine set del_flag='1' where id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="removePosMachineByIds" parameterType="String">
|
||||
update pos_machine set del_flag='1' where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</update>
|
||||
</mapper>
|
||||
@@ -0,0 +1,284 @@
|
||||
<?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.intc.invest.mapper.StatisticAnalysisMapper">
|
||||
|
||||
<resultMap type="BankCardLendVo" id="BankCardLendResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="name" column="name" />
|
||||
<result property="type" column="type" />
|
||||
<result property="code" column="code" />
|
||||
<result property="openingBank" column="opening_bank" />
|
||||
<result property="activationDate" column="activation_date" />
|
||||
<result property="billDate" column="bill_date" />
|
||||
<result property="payDate" column="pay_date" />
|
||||
<result property="delayPeriod" column="delay_period" />
|
||||
<result property="creditLimit" column="credit_limit" />
|
||||
<result property="effectiveDate" column="effective_date" />
|
||||
<result property="cvv" column="cvv" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="debitType" column="debit_type" />
|
||||
<result property="lendType" column="lend_type" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectBankCardLendVo">
|
||||
select
|
||||
a.name,
|
||||
a.type,
|
||||
a.credit_limit
|
||||
from
|
||||
bank_card_lend a
|
||||
</sql>
|
||||
|
||||
<select id="selectBankCardLendList" parameterType="BankCardLendDto" resultMap="BankCardLendResult">
|
||||
<include refid="selectBankCardLendVo"/>
|
||||
<where>
|
||||
a.del_flag='0'
|
||||
<if test="name != null and name != ''"> and a.name like '%'|| #{name}||'%'</if>
|
||||
<if test="type != null and type != ''"> and a.type = #{type}</if>
|
||||
<if test="creditCardId != null "> and a.id = #{creditCardId}</if>
|
||||
<if test="lendType != null and lendType != ''"> and a.lend_type = #{lendType}</if>
|
||||
</where>
|
||||
<!-- 数据范围过滤 -->
|
||||
${params.dataScope}
|
||||
</select>
|
||||
|
||||
<resultMap type="AccountsDealRecordVo" id="AccountsDealRecordResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="name" column="name" />
|
||||
<result property="code" column="code" />
|
||||
<result property="type" column="type" />
|
||||
<result property="accountId" column="account_id" />
|
||||
<result property="amount" column="amount" />
|
||||
<result property="dealType" column="deal_type" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="dealCategory" column="deal_category" />
|
||||
<result property="accountName" column="account_name" />
|
||||
<result property="transferRecordId" column="transfer_record_id" />
|
||||
<result property="currentBalance" column="current_balance" />
|
||||
<result property="childCategory" column="child_category" />
|
||||
</resultMap>
|
||||
|
||||
<select id="selectAccountsOutInList" parameterType="AccountsDealRecordDto" resultMap="AccountsDealRecordResult">
|
||||
select
|
||||
a.*
|
||||
from
|
||||
(
|
||||
select
|
||||
atr.id ,
|
||||
'13' as deal_category,
|
||||
'2' as deal_type,
|
||||
atr.commission as amount,
|
||||
atr.create_time ,
|
||||
atr.pos_id as account_id ,
|
||||
atr.create_by,
|
||||
atr.remark,
|
||||
p."name" as account_name ,
|
||||
p.code
|
||||
from
|
||||
accounts_transfer_record atr
|
||||
left join accounts p on
|
||||
p.id = atr.pos_id
|
||||
where
|
||||
atr."type" = '1'
|
||||
and atr.del_flag = '0'
|
||||
union
|
||||
select
|
||||
ihd.id ,
|
||||
case
|
||||
when ihd."type" = '2' then '14'
|
||||
when ihd."type" = '3' then '15'
|
||||
end as deal_category,
|
||||
'2' as deal_type,
|
||||
ihd.interest as amount,
|
||||
ihd.repayment_date as create_time,
|
||||
ihd.bank_card_lend_id as account_id ,
|
||||
ihd.create_by,
|
||||
ihd.remark,
|
||||
a."name" as account_name ,
|
||||
a.code
|
||||
from
|
||||
installment_history_detail ihd
|
||||
left join accounts a on
|
||||
a.id = ihd.bank_card_lend_id
|
||||
where
|
||||
ihd.del_flag = '0'
|
||||
union
|
||||
select
|
||||
adr.id ,
|
||||
adr.deal_category,
|
||||
adr.deal_type,
|
||||
adr.amount,
|
||||
adr.create_time ,
|
||||
adr.account_id ,
|
||||
adr.create_by,
|
||||
adr.remark,
|
||||
a."name" as account_name ,
|
||||
a.code
|
||||
from
|
||||
accounts_deal_record adr
|
||||
left join accounts a on
|
||||
a.id = adr.account_id
|
||||
where
|
||||
adr.del_flag = '0'
|
||||
and (
|
||||
adr.deal_category = '1'
|
||||
or adr.deal_category = '2'
|
||||
or adr.deal_category = '11'
|
||||
)
|
||||
) a
|
||||
<where>
|
||||
1=1
|
||||
<if test="endTime!=null and endTime !=''">
|
||||
and #{endTime}>=to_char(a.create_time, 'yyyy-MM-dd')
|
||||
</if>
|
||||
<if test="startTime!=null and startTime !=''">
|
||||
and to_char(a.create_time, 'yyyy-MM-dd')>=#{startTime}
|
||||
</if>
|
||||
<if test="dealCategory != null and dealCategory != ''"> and a.deal_category = #{dealCategory}</if>
|
||||
</where>
|
||||
<!-- 数据范围过滤 -->
|
||||
${params.dataScope}
|
||||
order by a.create_time desc
|
||||
</select>
|
||||
<select id="selectDailyExpensesList" parameterType="AccountsDealRecordDto" resultMap="AccountsDealRecordResult">
|
||||
select
|
||||
sum(a.amount) as amount ,
|
||||
a.child_category
|
||||
from
|
||||
accounts_deal_record a
|
||||
<where>
|
||||
a.del_flag='0'
|
||||
and a.deal_category = '1'
|
||||
<if test="endTime!=null and endTime !=''">
|
||||
and #{endTime}>=to_char(a.create_time, 'yyyy-MM-dd')
|
||||
</if>
|
||||
<if test="startTime!=null and startTime !=''">
|
||||
and to_char(a.create_time, 'yyyy-MM-dd')>=#{startTime}
|
||||
</if>
|
||||
<if test="accountId != null and accountId != ''"> and a.account_id = #{accountId}</if>
|
||||
<if test="childCategory != null and childCategory != ''"> and a.child_category = #{childCategory}</if>
|
||||
</where>
|
||||
<!-- 数据范围过滤 -->
|
||||
${params.dataScope}
|
||||
group by
|
||||
a.child_category
|
||||
order by sum(a.amount) desc
|
||||
</select>
|
||||
|
||||
<resultMap type="AccountCalendarVo" id="AccountCalendarResult">
|
||||
<result property="title" column="title" />
|
||||
<result property="name" column="name" />
|
||||
<result property="start" column="start" />
|
||||
<result property="color" column="color" />
|
||||
|
||||
</resultMap>
|
||||
<select id="selectDailyExpensesByDate" parameterType="AccountsDealRecordDto" resultMap="AccountCalendarResult">
|
||||
select
|
||||
to_char(a.create_time,
|
||||
'yyyy-MM-dd') as start,
|
||||
concat('日常支出:',
|
||||
sum(a.amount)) as title,
|
||||
'magenta' as color,
|
||||
5 as type
|
||||
from
|
||||
accounts_deal_record a
|
||||
<where>
|
||||
a.del_flag='0'
|
||||
and a.deal_type = '2'
|
||||
and a.deal_category = '1'
|
||||
<if test="endTime!=null and endTime !=''">
|
||||
and #{endTime}>=to_char(a.create_time, 'yyyy-MM-dd')
|
||||
</if>
|
||||
<if test="startTime!=null and startTime !=''">
|
||||
and to_char(a.create_time, 'yyyy-MM-dd')>=#{startTime}
|
||||
</if>
|
||||
</where>
|
||||
<!-- 数据范围过滤 -->
|
||||
${params.dataScope}
|
||||
group by
|
||||
to_char(a.create_time,
|
||||
'yyyy-MM-dd')
|
||||
</select>
|
||||
|
||||
<select id="selectSalaryByDate" parameterType="AccountsDealRecordDto" resultMap="AccountCalendarResult">
|
||||
select
|
||||
to_char(a.create_time,
|
||||
'yyyy-MM-dd') as start,
|
||||
concat('工资收入:',
|
||||
sum(a.amount)) as title,
|
||||
8 as type
|
||||
from
|
||||
accounts_deal_record a
|
||||
<where>
|
||||
a.del_flag='0'
|
||||
and a.deal_type = '1'
|
||||
and a.deal_category = '11'
|
||||
<if test="endTime!=null and endTime !=''">
|
||||
and #{endTime}>=to_char(a.create_time, 'yyyy-MM-dd')
|
||||
</if>
|
||||
<if test="startTime!=null and startTime !=''">
|
||||
and to_char(a.create_time, 'yyyy-MM-dd')>=#{startTime}
|
||||
</if>
|
||||
</where>
|
||||
<!-- 数据范围过滤 -->
|
||||
${params.dataScope}
|
||||
group by
|
||||
to_char(a.create_time,
|
||||
'yyyy-MM-dd')
|
||||
</select>
|
||||
|
||||
<select id="selectDailyExpensesDateList" parameterType="AccountsDealRecordDto" resultMap="AccountsDealRecordResult">
|
||||
select
|
||||
sum(a.amount) as amount ,
|
||||
to_char(a.create_time,
|
||||
'yyyy-MM-dd') as dateStr
|
||||
from
|
||||
accounts_deal_record a
|
||||
<where>
|
||||
a.del_flag = '0'
|
||||
and a.deal_type = '2'
|
||||
and a.deal_category = '1'
|
||||
<if test="endTime!=null and endTime !=''">
|
||||
and #{endTime}>=to_char(a.create_time, 'yyyy-MM-dd')
|
||||
</if>
|
||||
<if test="startTime!=null and startTime !=''">
|
||||
and to_char(a.create_time, 'yyyy-MM-dd')>=#{startTime}
|
||||
</if>
|
||||
</where>
|
||||
<!-- 数据范围过滤 -->
|
||||
${params.dataScope}
|
||||
group by
|
||||
to_char(a.create_time,
|
||||
'yyyy-MM-dd')
|
||||
order by
|
||||
to_char(a.create_time,
|
||||
'yyyy-MM-dd') desc
|
||||
</select>
|
||||
|
||||
<select id="selectCreditCardList" parameterType="BankCardLendDto" resultType="com.intc.invest.domain.vo.AccountsVo">
|
||||
select
|
||||
a."name" ,
|
||||
sum(a.available_limit) as availableLimit
|
||||
from
|
||||
accounts a
|
||||
where
|
||||
a."type" = '2'
|
||||
and a.status = '1'
|
||||
<!-- 数据范围过滤 -->
|
||||
${params.dataScope}
|
||||
group by a."name"
|
||||
|
||||
</select>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user