1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- <?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.cool.bang.modules.mysql.mapper.ProjectAccountMapper">
- <!-- 结果集 -->
- <resultMap id="projectAccountMap" type="com.cool.bang.modules.mysql.domain.ProjectAccount">
- <id property="id" column="id" jdbcType="BIGINT"/>
- <result property="bankCode" column="bank_code" jdbcType="VARCHAR"/>
- <result property="bankName" column="bank_name" jdbcType="VARCHAR"/>
- <result property="orgId" column="org_id" jdbcType="INTEGER"/>
- <result property="orgName" column="org_name" jdbcType="VARCHAR"/>
- <result property="projectId" column="project_id" jdbcType="BIGINT"/>
- <result property="projectNumber" column="project_number" jdbcType="VARCHAR"/>
- <result property="projectName" column="project_name" jdbcType="VARCHAR"/>
- <result property="projectAddress" column="project_address" jdbcType="VARCHAR"/>
- <result property="buildingTotal" column="building_total" jdbcType="INTEGER"/>
- <result property="buildArea" column="build_area" jdbcType="DECIMAL"/>
- <result property="superviseAmount" column="supervise_amount" jdbcType="DECIMAL"/>
- <result property="keepAmount" column="keep_amount" jdbcType="DECIMAL"/>
- <result property="accountId" column="account_id" jdbcType="INTEGER"/>
- <result property="trusteeshipBalance" column="trusteeship_balance" jdbcType="DECIMAL"/>
- <result property="superviseBalance" column="supervise_balance" jdbcType="DECIMAL"/>
- <result property="trusteeshipInTransitFund" column="trusteeship_in_transit_fund" jdbcType="DECIMAL"/>
- <result property="superviseInTransitFund" column="supervise_in_transit_fund" jdbcType="DECIMAL"/>
- <result property="buildCostId" column="build_cost_id" jdbcType="BIGINT"/>
- <result property="buildCostName" column="build_cost_name" jdbcType="VARCHAR"/>
- <result property="relieveDate" column="relieve_date" jdbcType="VARCHAR"/>
- <result property="isFrozen" column="is_frozen" jdbcType="INTEGER"/>
- <result property="accountType" column="account_type" jdbcType="INTEGER"/>
- <result property="state" column="state" jdbcType="INTEGER"/>
- <result property="delFlag" column="del_flag" jdbcType="TINYINT"/>
- </resultMap>
- <!-- 插入项目虚拟户表数据 -->
- <insert id="insertProjectAccount" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
- insert into
- fc_project_account (id, aregid, bank_code, bank_name, org_id, org_name, project_id, project_number, project_name, project_address, building_total, build_area, supervise_amount, keep_amount, account_id, trusteeship_balance, supervise_balance, trusteeship_in_transit_fund, supervise_in_transit_fund, build_cost_id, build_cost_name, relieve_date, is_frozen, account_type, state, create_time, del_flag)
- values
- (#{id}, #{aregid}, #{bankCode}, #{bankName}, #{orgId}, #{orgName}, #{projectId}, #{projectNumber}, #{projectName}, #{projectAddress}, #{buildingTotal}, #{buildArea}, #{superviseAmount}, #{keepAmount}, #{accountId}, #{trusteeshipBalance}, #{superviseBalance}, #{trusteeshipInTransitFund}, #{superviseInTransitFund}, #{buildCostId}, #{buildCostName}, #{relieveDate}, #{isFrozen}, #{accountType}, #{state}, #{createTime}, #{delFlag})
- </insert>
- <!-- 通过yszjjg-aregid查询 -->
- <select id="selectByAregid" resultMap="projectAccountMap">
- select
- id, bank_code, bank_name, org_id, org_name, project_id, project_number, project_name, project_address, building_total, build_area, supervise_amount, keep_amount, account_id, trusteeship_balance, supervise_balance, trusteeship_in_transit_fund, supervise_in_transit_fund, build_cost_id, build_cost_name, relieve_date, is_frozen, account_type, state, create_time
- from
- fc_project_account
- where
- aregid = #{aregid}
- </select>
- <!-- 更新留存金额 -->
- <update id="updateKeepAmount">
- update fc_project_account
- set
- keep_amount = (select sum(keep_amount) from fc_building_account where project_account_id = #{id})
- where id = #{id}
- </update>
- <!-- 更新留存金额 -->
- <update id="updateTrusteeshipInTransit">
- update fc_project_account
- set
- trusteeship_in_transit_fund = (select sum(in_transit_fund) from fc_building_account where project_account_id = #{id})
- where id = #{id}
- </update>
- <!-- 更新留存金额 -->
- <update id="updateSuperviseInTransit">
- update fc_project_account
- set
- supervise_in_transit_fund = (select sum(in_transit_fund) from fc_building_account where project_account_id = #{id})
- where id = #{id}
- </update>
- <select id="selectByAccount" resultMap="projectAccountMap">
- select * from fc_project_account where project_id = #{id}
- </select>
- </mapper>
|