|
@@ -29,6 +29,7 @@
|
|
|
<result column="organ_name_" property="organName"/>
|
|
|
<result column="platform_account_no_" property="platformAccountNo"/>
|
|
|
<result column="group_id_" property="groupId"/>
|
|
|
+ <result column="tenant_id_" property="tenantId"/>
|
|
|
</resultMap>
|
|
|
|
|
|
<!-- 根据主键查询一条记录 -->
|
|
@@ -39,7 +40,7 @@
|
|
|
<!-- 全查询 -->
|
|
|
<select id="findAll" resultMap="SysUserCashAccountDetail">
|
|
|
SELECT *
|
|
|
- FROM sys_user_cash_account_detail
|
|
|
+ FROM sys_user_cash_account_detail where tenant_id_ = #{tenantId}
|
|
|
ORDER BY id_
|
|
|
</select>
|
|
|
|
|
@@ -66,6 +67,7 @@
|
|
|
<if test="attribute!=null">attribute1_,</if>
|
|
|
<if test="channel!=null">channel_,</if>
|
|
|
<if test="platformAccountNo!=null">platform_account_no_,</if>
|
|
|
+ tenant_id_
|
|
|
</trim>
|
|
|
VALUES
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
@@ -87,6 +89,7 @@
|
|
|
<if test="attribute!=null">#{attribute},</if>
|
|
|
<if test="channel!=null">#{channel},</if>
|
|
|
<if test="platformAccountNo!=null">#{platformAccountNo},</if>
|
|
|
+ #{tenantId}
|
|
|
</trim>
|
|
|
</insert>
|
|
|
|
|
@@ -94,7 +97,7 @@
|
|
|
keyColumn="id" keyProperty="id">
|
|
|
INSERT INTO sys_user_cash_account_detail
|
|
|
(user_id_,trans_no_,type_,trans_type_,status_,amount_,balance_,description_,comment_,
|
|
|
- create_time_,update_time_,attribute1_,channel_,platform_account_no_,group_id_)
|
|
|
+ create_time_,update_time_,attribute1_,channel_,platform_account_no_,group_id_,tenant_id_)
|
|
|
VALUE
|
|
|
<foreach collection="sysUserCashAccountDetails" item="sysUserCashAccountDetail" separator=",">
|
|
|
(#{sysUserCashAccountDetail.userId},#{sysUserCashAccountDetail.transNo},
|
|
@@ -103,7 +106,7 @@
|
|
|
#{sysUserCashAccountDetail.status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
|
|
|
#{sysUserCashAccountDetail.amount},#{sysUserCashAccountDetail.balance},#{sysUserCashAccountDetail.description},
|
|
|
#{sysUserCashAccountDetail.comment},now(),now(),#{sysUserCashAccountDetail.attribute},#{sysUserCashAccountDetail.channel},
|
|
|
- #{sysUserCashAccountDetail.platformAccountNo},#{sysUserCashAccountDetail.groupId})
|
|
|
+ #{sysUserCashAccountDetail.platformAccountNo},#{sysUserCashAccountDetail.groupId},#{sysUserCashAccountDetail.tenantId})
|
|
|
</foreach>
|
|
|
</insert>
|
|
|
|
|
@@ -155,7 +158,7 @@
|
|
|
platform_account_no_ = #{platformAccountNo},
|
|
|
</if>
|
|
|
</set>
|
|
|
- WHERE id_ = #{id}
|
|
|
+ WHERE id_ = #{id} and tenant_id_ = #{tenantId}
|
|
|
</update>
|
|
|
|
|
|
<!-- 根据主键删除一条记录 -->
|
|
@@ -167,8 +170,9 @@
|
|
|
<select id="queryPage" resultMap="SysUserCashAccountDetail" parameterType="map">
|
|
|
SELECT * FROM sys_user_cash_account_detail
|
|
|
<where>
|
|
|
+ tenant_id_ = #{tenantId}
|
|
|
<if test="userId != null">
|
|
|
- user_id_ = #{userId}
|
|
|
+ and user_id_ = #{userId}
|
|
|
</if>
|
|
|
<if test="search != null and search != ''">
|
|
|
AND create_time_ LIKE CONCAT(#{search},'%')
|
|
@@ -185,8 +189,9 @@
|
|
|
<select id="queryCount" resultType="int">
|
|
|
SELECT COUNT(*) FROM sys_user_cash_account_detail
|
|
|
<where>
|
|
|
+ tenant_id_ = #{tenantId}
|
|
|
<if test="userId != null">
|
|
|
- user_id_ = #{userId}
|
|
|
+ and user_id_ = #{userId}
|
|
|
</if>
|
|
|
<if test="search != null and search != ''">
|
|
|
AND create_time_ LIKE CONCAT(#{search},'%')
|
|
@@ -209,9 +214,7 @@
|
|
|
sys_user_cash_account_detail sucad
|
|
|
left join sys_user u on sucad.user_id_ = u.id_
|
|
|
where sucad.status_ = 'SUCCESS' and DATE_FORMAT(sucad.create_time_, '%Y%m' ) = DATE_FORMAT( CURDATE() , '%Y%m' ) and u.organ_id_ not in (36,38)
|
|
|
- <if test="organId != null">
|
|
|
AND FIND_IN_SET(u.organ_id_,#{organId})
|
|
|
- </if>
|
|
|
</select>
|
|
|
<select id="countByTypeAndTime" resultType="java.lang.Integer">
|
|
|
SELECT COUNT(s.id_) FROM sys_user_cash_account_detail s
|
|
@@ -221,8 +224,9 @@
|
|
|
|
|
|
<sql id="queryAccountDetailCondition">
|
|
|
<where>
|
|
|
+ tenant_id_ = #{tenantId}
|
|
|
<if test="userId!=null">
|
|
|
- user_id_=#{userId}
|
|
|
+ and user_id_=#{userId}
|
|
|
</if>
|
|
|
</where>
|
|
|
</sql>
|
|
@@ -252,6 +256,7 @@
|
|
|
LEFT JOIN student s ON s.user_id_ = su.id_
|
|
|
LEFT JOIN `subject` sb ON FIND_IN_SET(sb.id_,s.subject_id_list_)
|
|
|
<where>
|
|
|
+ cad.tenant_id_ = #{queryInfo.tenantId}
|
|
|
<if test="queryInfo.userId != null">
|
|
|
AND cad.user_id_ = #{queryInfo.userId}
|
|
|
</if>
|