|
@@ -26,35 +26,27 @@
|
|
|
CREATE TABLE IF NOT EXISTS `${tableName}` LIKE kxs_user_amount_log;
|
|
CREATE TABLE IF NOT EXISTS `${tableName}` LIKE kxs_user_amount_log;
|
|
|
</update>
|
|
</update>
|
|
|
<select id="getByPage" resultType="com.kxs.user.api.vo.kxsapp.userAccount.UserAmountVariationListVO">
|
|
<select id="getByPage" resultType="com.kxs.user.api.vo.kxsapp.userAccount.UserAmountVariationListVO">
|
|
|
- SELECT * FROM ${tableName}
|
|
|
|
|
|
|
+ SELECT *, c.name as variation_type_name,u.user_code as source_user
|
|
|
|
|
+ FROM ${tableName} a
|
|
|
|
|
+ left join kxs_change_type_kind c on c.id = a.variation_type
|
|
|
|
|
+ left join kxs_user u on u.id = a.variation_cause
|
|
|
<where>
|
|
<where>
|
|
|
- AND del_flag = 0
|
|
|
|
|
- AND user_id = #{query.userId}
|
|
|
|
|
|
|
+ AND a.del_flag = 0
|
|
|
|
|
+ AND a.user_id = #{query.userId}
|
|
|
<if test="query.kind != null and query.kind != ''">
|
|
<if test="query.kind != null and query.kind != ''">
|
|
|
- AND kind = #{query.kind}
|
|
|
|
|
|
|
+ AND a.kind = #{query.kind}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="query.brandIds != null">
|
|
<if test="query.brandIds != null">
|
|
|
- AND ${tableName}.brand_id IN
|
|
|
|
|
|
|
+ AND a.brand_id IN
|
|
|
<foreach item="brandId" index="index" collection="query.brandIds" open="(" separator="," close=")">
|
|
<foreach item="brandId" index="index" collection="query.brandIds" open="(" separator="," close=")">
|
|
|
#{brandId}
|
|
#{brandId}
|
|
|
</foreach>
|
|
</foreach>
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="query.changeType != null">
|
|
|
|
|
- AND variation_type IN (
|
|
|
|
|
- SELECT
|
|
|
|
|
- kctk.id
|
|
|
|
|
- FROM
|
|
|
|
|
- kxs_change_type_kind kctk
|
|
|
|
|
- LEFT JOIN
|
|
|
|
|
- kxs_change_type kct
|
|
|
|
|
- ON
|
|
|
|
|
- kctk.change_type_id = kct.id
|
|
|
|
|
- WHERE
|
|
|
|
|
- kct.id In
|
|
|
|
|
|
|
+ <if test="query.changeType != null and query.changeType.size() > 0">
|
|
|
|
|
+ AND a.variation_type IN
|
|
|
<foreach item="ct" index="index" collection="query.changeType" open="(" separator="," close=")">
|
|
<foreach item="ct" index="index" collection="query.changeType" open="(" separator="," close=")">
|
|
|
#{ct}
|
|
#{ct}
|
|
|
</foreach>
|
|
</foreach>
|
|
|
- )
|
|
|
|
|
</if>
|
|
</if>
|
|
|
</where>
|
|
</where>
|
|
|
</select>
|
|
</select>
|