|
|
@@ -3,7 +3,7 @@
|
|
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
<mapper namespace="com.fs.company.mapper.CompanyMoneyLogsMapper">
|
|
|
-
|
|
|
+
|
|
|
<resultMap type="CompanyMoneyLogs" id="CompanyMoneyLogsResult">
|
|
|
<result property="logsId" column="logs_id" />
|
|
|
<result property="companyId" column="company_id" />
|
|
|
@@ -13,20 +13,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<result property="createTime" column="create_time" />
|
|
|
<result property="logsType" column="logs_type" />
|
|
|
<result property="businessId" column="business_id" />
|
|
|
+ <result property="type" column="type" />
|
|
|
</resultMap>
|
|
|
|
|
|
<sql id="selectCompanyMoneyLogsVo">
|
|
|
- select logs_id, company_id, money,balance, remark, create_time,logs_type,business_id from company_money_logs
|
|
|
+ select logs_id, company_id, money,balance, remark, create_time,logs_type,business_id,type from company_money_logs
|
|
|
</sql>
|
|
|
|
|
|
<select id="selectCompanyMoneyLogsList" parameterType="CompanyMoneyLogs" resultMap="CompanyMoneyLogsResult">
|
|
|
<include refid="selectCompanyMoneyLogsVo"/>
|
|
|
- <where>
|
|
|
+ <where>
|
|
|
<if test="companyId != null "> and company_id = #{companyId}</if>
|
|
|
<if test="money != null "> and money = #{money}</if>
|
|
|
</where>
|
|
|
</select>
|
|
|
-
|
|
|
+
|
|
|
<select id="selectCompanyMoneyLogsById" parameterType="Long" resultMap="CompanyMoneyLogsResult">
|
|
|
<include refid="selectCompanyMoneyLogsVo"/>
|
|
|
where logs_id = #{logsId}
|
|
|
@@ -47,6 +48,29 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
GROUP BY l.company_user_id
|
|
|
order by c.company_id,u.user_id
|
|
|
</select>
|
|
|
+ <!-- 批量更新公司金额日志 -->
|
|
|
+ <update id="batchUpdateCompanyMoneyLogs" parameterType="java.util.List">
|
|
|
+ update company_money_logs set
|
|
|
+ money = CASE logs_id
|
|
|
+ <foreach collection="list" item="log" separator=" ">
|
|
|
+ WHEN #{log.logsId} THEN #{log.money}
|
|
|
+ </foreach>
|
|
|
+ END,
|
|
|
+ balance = CASE logs_id
|
|
|
+ <foreach collection="list" item="log" separator=" ">
|
|
|
+ WHEN #{log.logsId} THEN #{log.balance}
|
|
|
+ </foreach>
|
|
|
+ END,
|
|
|
+ remark = CASE logs_id
|
|
|
+ <foreach collection="list" item="log" separator=" ">
|
|
|
+ WHEN #{log.logsId} THEN #{log.remark}
|
|
|
+ </foreach>
|
|
|
+ END
|
|
|
+ where logs_id in
|
|
|
+ <foreach collection="list" index="index" item="log" separator="," open="(" close=")">
|
|
|
+ #{log.logsId}
|
|
|
+ </foreach>
|
|
|
+ </update>
|
|
|
|
|
|
<insert id="insertCompanyMoneyLogs" parameterType="CompanyMoneyLogs" useGeneratedKeys="true" keyProperty="logsId">
|
|
|
insert into company_money_logs
|
|
|
@@ -58,6 +82,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="createTime != null">create_time,</if>
|
|
|
<if test="logsType != null">logs_type,</if>
|
|
|
<if test="businessId != null">business_id,</if>
|
|
|
+ <if test="type != null">type,</if>
|
|
|
</trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
<if test="companyId != null">#{companyId},</if>
|
|
|
@@ -67,6 +92,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="createTime != null">#{createTime},</if>
|
|
|
<if test="logsType != null">#{logsType},</if>
|
|
|
<if test="businessId != null">#{businessId},</if>
|
|
|
+ <if test="type != null">#{type},</if>
|
|
|
</trim>
|
|
|
</insert>
|
|
|
|
|
|
@@ -80,6 +106,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="createTime != null">create_time = #{createTime},</if>
|
|
|
<if test="logsType != null">logs_type = #{logsType},</if>
|
|
|
<if test="businessId != null">business_id = #{businessId},</if>
|
|
|
+ <if test="type != null">business_id = #{type},</if>
|
|
|
+
|
|
|
</trim>
|
|
|
where logs_id = #{logsId}
|
|
|
</update>
|
|
|
@@ -89,10 +117,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</delete>
|
|
|
|
|
|
<delete id="deleteCompanyMoneyLogsByIds" parameterType="String">
|
|
|
- delete from company_money_logs where logs_id in
|
|
|
+ delete from company_money_logs where logs_id in
|
|
|
<foreach item="logsId" collection="array" open="(" separator="," close=")">
|
|
|
#{logsId}
|
|
|
</foreach>
|
|
|
</delete>
|
|
|
-
|
|
|
-</mapper>
|
|
|
+
|
|
|
+</mapper>
|