|
@@ -5,7 +5,7 @@
|
|
|
不要修改此文件。所有改动将在下次重新自动生成时丢失。
|
|
|
-->
|
|
|
<mapper namespace="com.ym.mec.collectfee.dao.AccountDao">
|
|
|
-
|
|
|
+
|
|
|
<resultMap type="com.ym.mec.collectfee.entity.Account" id="Account">
|
|
|
<result column="id" property="id" />
|
|
|
<result column="branch_id" property="branchId" />
|
|
@@ -14,27 +14,27 @@
|
|
|
<result column="has_routing" property="hasRouting" />
|
|
|
<result column="version" property="version" />
|
|
|
</resultMap>
|
|
|
-
|
|
|
+
|
|
|
<!-- 根据主键查询一条记录 -->
|
|
|
<select id="get" resultMap="Account" >
|
|
|
SELECT * FROM `account` WHERE id = #{id}
|
|
|
</select>
|
|
|
-
|
|
|
+
|
|
|
<!-- 全查询 -->
|
|
|
<select id="findAll" resultMap="Account">
|
|
|
SELECT * FROM `account` ORDER BY id
|
|
|
</select>
|
|
|
-
|
|
|
+
|
|
|
<!-- 向数据库增加一条记录 -->
|
|
|
<insert id="insert" parameterType="com.ym.mec.collectfee.entity.Account" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
|
|
|
<!--
|
|
|
- <selectKey resultClass="int" keyProperty="id" >
|
|
|
- SELECT SEQ_WSDEFINITION_ID.nextval AS ID FROM DUAL
|
|
|
+ <selectKey resultClass="int" keyProperty="id" >
|
|
|
+ SELECT SEQ_WSDEFINITION_ID.nextval AS ID FROM DUAL
|
|
|
</selectKey>
|
|
|
-->
|
|
|
INSERT INTO `account` (id,branch_id,seller_no,max_routing,has_routing) VALUES(#{id},#{branchId},#{sellerNo},#{maxRouting},#{hasRouting})
|
|
|
</insert>
|
|
|
-
|
|
|
+
|
|
|
<!-- 根据主键查询一条记录 -->
|
|
|
<update id="update" parameterType="com.ym.mec.collectfee.entity.Account">
|
|
|
UPDATE `account`
|
|
@@ -54,17 +54,17 @@
|
|
|
</set>
|
|
|
WHERE id = #{id}
|
|
|
</update>
|
|
|
-
|
|
|
+
|
|
|
<!-- 根据主键删除一条记录 -->
|
|
|
<delete id="delete" >
|
|
|
DELETE FROM `account` WHERE id = #{id}
|
|
|
</delete>
|
|
|
-
|
|
|
+
|
|
|
<!-- 分页查询 -->
|
|
|
<select id="queryPage" resultMap="Account" parameterType="map">
|
|
|
SELECT * FROM `account` ORDER BY id <include refid="global.limit"/>
|
|
|
</select>
|
|
|
-
|
|
|
+
|
|
|
<!-- 查询当前表的总记录数 -->
|
|
|
<select id="queryCount" resultType="int">
|
|
|
SELECT COUNT(*) FROM `account`
|
|
@@ -72,7 +72,7 @@
|
|
|
|
|
|
<!-- 根据分部id获取分部收款账户 -->
|
|
|
<select id="getAccountByBranchId" resultMap="Account" >
|
|
|
- SELECT * FROM `account` WHERE branch_id = #{branchId} AND `max_routing` > `has_routing` ORDER BY `id` ASC LIMIT 1
|
|
|
+ SELECT * FROM `account` WHERE branch_id = #{branchId} AND `max_routing` > `has_routing`+ #{money} ORDER BY `id` ASC LIMIT 1
|
|
|
</select>
|
|
|
|
|
|
<!-- 根据id和version更新已收金额 -->
|