|
|
@@ -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" />
|
|
|
@@ -21,12 +21,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
|
<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 +47,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
GROUP BY l.company_user_id
|
|
|
order by c.company_id,u.user_id
|
|
|
</select>
|
|
|
+ <select id="selectCompanyMoneyLogsTotalMoney" resultType="java.math.BigDecimal">
|
|
|
+ select sum(money) from company_money_logs
|
|
|
+ <where>
|
|
|
+ <if test="maps.companyId != null "> and company_id = #{maps.companyId}</if>
|
|
|
+ <if test="maps.logsType != null"> and logs_type = #{maps.logsType}</if>
|
|
|
+ <if test="maps.createTimeList != null">
|
|
|
+ AND date_format(create_time,'%y%m%d') >= date_format(#{maps.createTimeList[0]},'%y%m%d')
|
|
|
+ AND date_format(create_time,'%y%m%d') <= date_format(#{maps.createTimeList[1]},'%y%m%d')
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+
|
|
|
+ </select>
|
|
|
|
|
|
<insert id="insertCompanyMoneyLogs" parameterType="CompanyMoneyLogs" useGeneratedKeys="true" keyProperty="logsId">
|
|
|
insert into company_money_logs
|
|
|
@@ -89,10 +101,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>
|