pick-pack-mapper.xml
2.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<?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">
<!-- 提货封装设置(hs_asset)(关联表hs_asset.pick_pack) @author togxiaochuan -->
<mapper namespace="com.cjs.site.dao.user.pick.PickPackDao">
<sql id="pick_pack_field">
ID, OTC_CODE, OTC_NAME, PACK_STATUS, TRUST_STATUS,
CREATE_DATE, CREATE_TIME, CREATE_BY
</sql>
<select id="queryAll" resultType="PickPackInfo">
SELECT <include refid="pick_pack_field" />
FROM HS_ASSET.PICK_PACK
WHERE PACK_STATUS = '1'
ORDER BY ID DESC
</select>
<select id="queryById" parameterType="int" resultType="PickPackInfo">
SELECT <include refid="pick_pack_field" />
FROM HS_ASSET.PICK_PACK
WHERE ID = #{id}
</select>
<select id="queryUserPosition" parameterType="string" resultType="PickPackInfo">
select
a.otc_code as otcCode ,
d.otc_name AS otcName ,
a.current_amount as currentAmount
from hs_otc.otcstockreal a, hs_asset.clientinfo b, hs_asset.client c,hs_otc.otccode d
where a.client_id = b.client_id
and a.client_id = c.client_id
and a.otc_code=d.otc_code
and a.client_id = #{userId}
</select>
<select id="queryUserFundAccount" resultType="java.util.HashMap" parameterType="string" >
select current_balance from hs_fund.fundreal a where a.client_id =#{userId}
</select>
<update id="ducueUserFundAmount">
update hs_fund.fundreal set current_balance = current_balance-#{money} where client_id =#{userId}
</update>
<update id="ducueUserInventory">
update hs_otc.otcstockreal set current_amount = current_amount-#{amount} where client_id =#{userId} and otc_code=#{otcCode}
</update>
<insert id="insertPick" parameterType="java.util.HashMap">
insert into HS_ASSET.OUTPROPAPPLY(
OTC_CODE, OTC_NAME, OCCUR_AMOUNT, PICKING_DATE,
PHONE_CODE, PICKING_ADDRESS,REMARK, OP_STATION,
SDCPROPAPPLY_STATUS, EXPRESS_ADRESS,
INIT_DATE,PICKING_NAME,POSITION_STR
) values(
#{otcCode},#{otcName},#{occurAmount},#{pickDate},
#{phone,jdbcType=VARCHAR},#{pikingAddress,jdbcType=VARCHAR},'临时解决',#{opStation},
0,#{address,jdbcType=VARCHAR},#{initDate},#{pickName,jdbcType=VARCHAR},#{postionStr,jdbcType=VARCHAR}
)
</insert>
</mapper>