2024-10-24 05:04:26 +00:00
|
|
|
<?xml version="1.0" encoding="UTF-8" ?>
|
|
|
|
|
<!DOCTYPE mapper
|
2024-10-24 09:00:30 +00:00
|
|
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
2024-10-24 05:04:26 +00:00
|
|
|
<mapper namespace="com.xdadan.erp.emis.mapper.EmisCommissionProfitMapper">
|
2024-10-24 09:00:30 +00:00
|
|
|
|
2024-10-24 05:04:26 +00:00
|
|
|
<resultMap type="EmisCommissionProfit" id="EmisCommissionProfitResult">
|
|
|
|
|
<result property="id" column="id" />
|
|
|
|
|
<result property="profitNo" column="profit_no" />
|
|
|
|
|
<result property="empCode" column="emp_code" />
|
|
|
|
|
<result property="empName" column="emp_name" />
|
2024-10-24 09:00:30 +00:00
|
|
|
<result property="billMonth" column="bill_month" />
|
|
|
|
|
<result property="money" column="money" />
|
|
|
|
|
<result property="realMoney" column="real_money" />
|
|
|
|
|
<result property="payedMoney" column="payed_money" />
|
2024-10-24 05:04:26 +00:00
|
|
|
<result property="blConfirmCenter" column="bl_confirm_center" />
|
|
|
|
|
<result property="confirmCenterDate" column="confirm_center_date" />
|
|
|
|
|
<result property="confirmCenterNote" column="confirm_center_note" />
|
|
|
|
|
<result property="confirmCenterManCode" column="confirm_center_man_code" />
|
|
|
|
|
<result property="confirmCenterCode" column="confirm_center_code" />
|
|
|
|
|
<result property="blConfirmSite" column="bl_confirm_site" />
|
|
|
|
|
<result property="confirmSiteDate" column="confirm_site_date" />
|
|
|
|
|
<result property="confirmSiteManCode" column="confirm_site_man_code" />
|
|
|
|
|
<result property="confirmSiteNote" column="confirm_site_note" />
|
|
|
|
|
<result property="confirmSiteCode" column="confirm_site_code" />
|
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
|
<sql id="selectEmisCommissionProfitVo">
|
2024-10-24 09:00:30 +00:00
|
|
|
select id, profit_no, emp_code, emp_name, bill_month, money, real_money, payed_money, bl_confirm_center, confirm_center_date, confirm_center_note, confirm_center_man_code, confirm_center_code, bl_confirm_site, confirm_site_date, confirm_site_man_code, confirm_site_note, confirm_site_code, remark, del_flag, create_by, create_time, update_by, update_time, create_site, update_site from emis_commission_profit
|
2024-10-24 05:04:26 +00:00
|
|
|
</sql>
|
|
|
|
|
|
2024-11-14 15:18:17 +00:00
|
|
|
<select id="selectProfitStatList" parameterType="String" resultMap="EmisCommissionProfitResult">
|
2024-11-14 20:59:34 +00:00
|
|
|
select emp_name ,bill_month, sum(money) as money
|
2024-11-14 15:18:17 +00:00
|
|
|
from emis_commission_dtl a
|
2024-11-21 11:40:19 +00:00
|
|
|
where del_flag='0'
|
|
|
|
|
<if test="empName != null and empName != ''">
|
2024-11-21 12:26:21 +00:00
|
|
|
and a.emp_name = #{empName}
|
2024-11-21 11:40:19 +00:00
|
|
|
</if>
|
2024-11-14 15:18:17 +00:00
|
|
|
<if test="billMonth != null and billMonth != ''">
|
2024-11-21 12:26:21 +00:00
|
|
|
and bill_month=#{billMonth}
|
2024-11-14 15:18:17 +00:00
|
|
|
</if>
|
|
|
|
|
group by emp_name,bill_month
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
2024-10-24 05:04:26 +00:00
|
|
|
<select id="selectEmisCommissionProfitList" parameterType="EmisCommissionProfit" resultMap="EmisCommissionProfitResult">
|
|
|
|
|
<include refid="selectEmisCommissionProfitVo"/>
|
2024-10-24 09:00:30 +00:00
|
|
|
<where>
|
|
|
|
|
del_flag='0'
|
2024-10-24 05:04:26 +00:00
|
|
|
<if test="id != null "> and id = #{id}</if>
|
|
|
|
|
<if test="profitNo != null and profitNo != ''"> and profit_no like concat('%', #{profitNo}, '%')</if>
|
|
|
|
|
<if test="empCode != null and empCode != ''"> and emp_code like concat('%', #{empCode}, '%')</if>
|
2024-11-14 15:18:17 +00:00
|
|
|
<if test="empName != null and empName != ''"> and emp_name=#{empName}</if>
|
|
|
|
|
<if test="billMonth != null and billMonth != ''"> and bill_month=#{billMonth}</if>
|
2024-10-24 09:00:30 +00:00
|
|
|
<if test="money != null "> and money = #{money}</if>
|
|
|
|
|
<if test="realMoney != null "> and real_money = #{realMoney}</if>
|
|
|
|
|
<if test="payedMoney != null "> and payed_money = #{payedMoney}</if>
|
2024-11-14 15:18:17 +00:00
|
|
|
<if test="blConfirmCenter != null and blConfirmCenter != ''"> and bl_confirm_center=#{blConfirmCenter}</if>
|
2024-10-24 05:04:26 +00:00
|
|
|
<if test="confirmCenterDate != null "> and confirm_center_date = #{confirmCenterDate}</if>
|
|
|
|
|
<if test="confirmCenterNote != null and confirmCenterNote != ''"> and confirm_center_note like concat('%', #{confirmCenterNote}, '%')</if>
|
|
|
|
|
<if test="confirmCenterManCode != null and confirmCenterManCode != ''"> and confirm_center_man_code like concat('%', #{confirmCenterManCode}, '%')</if>
|
|
|
|
|
<if test="confirmCenterCode != null and confirmCenterCode != ''"> and confirm_center_code like concat('%', #{confirmCenterCode}, '%')</if>
|
2024-11-14 15:18:17 +00:00
|
|
|
<if test="blConfirmSite != null and blConfirmSite != ''"> and bl_confirm_site=#{blConfirmSite}</if>
|
2024-10-24 05:04:26 +00:00
|
|
|
<if test="confirmSiteDate != null "> and confirm_site_date = #{confirmSiteDate}</if>
|
2024-11-14 15:18:17 +00:00
|
|
|
<if test="confirmSiteManCode != null and confirmSiteManCode != ''"> and confirm_site_man_code=#{confirmSiteManCode}</if>
|
2024-10-24 05:04:26 +00:00
|
|
|
<if test="confirmSiteNote != null and confirmSiteNote != ''"> and confirm_site_note like concat('%', #{confirmSiteNote}, '%')</if>
|
2024-11-14 15:18:17 +00:00
|
|
|
<if test="confirmSiteCode != null and confirmSiteCode != ''"> and confirm_site_code=#{confirmSiteCode}</if>
|
2024-10-24 05:04:26 +00:00
|
|
|
<if test="remark != null and remark != ''"> and remark like concat('%', #{remark}, '%')</if>
|
|
|
|
|
<if test="delFlag != null and delFlag != ''"> and del_flag like concat('%', #{delFlag}, '%')</if>
|
|
|
|
|
<if test="createBy != null and createBy != ''"> and create_by like concat('%', #{createBy}, '%')</if>
|
|
|
|
|
<if test="createTime != null "> and create_time = #{createTime}</if>
|
|
|
|
|
<if test="updateBy != null and updateBy != ''"> and update_by like concat('%', #{updateBy}, '%')</if>
|
|
|
|
|
<if test="updateTime != null "> and update_time = #{updateTime}</if>
|
|
|
|
|
<if test="createSite != null and createSite != ''"> and create_site like concat('%', #{createSite}, '%')</if>
|
|
|
|
|
<if test="updateSite != null and updateSite != ''"> and update_site like concat('%', #{updateSite}, '%')</if>
|
|
|
|
|
</where>
|
|
|
|
|
order by create_time desc
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="checkUnique" parameterType="EmisCommissionProfit" resultType="int">
|
|
|
|
|
select count(1) from emis_commission_profit
|
|
|
|
|
where del_flag='0'
|
|
|
|
|
and emp_name = #{empName}
|
2024-10-24 09:00:30 +00:00
|
|
|
and bill_month = #{billMonth}
|
2024-10-24 05:04:26 +00:00
|
|
|
limit 1
|
|
|
|
|
</select>
|
2024-10-24 09:00:30 +00:00
|
|
|
|
2024-10-24 05:04:26 +00:00
|
|
|
<select id="selectEmisCommissionProfitById" parameterType="Long" resultMap="EmisCommissionProfitResult">
|
2024-10-24 09:00:30 +00:00
|
|
|
select id, profit_no, emp_code, emp_name, bill_month, money, real_money, payed_money, bl_confirm_center, confirm_center_date, confirm_center_note, confirm_center_man_code, confirm_center_code, bl_confirm_site, confirm_site_date, confirm_site_man_code, confirm_site_note, confirm_site_code, remark, del_flag, create_by, create_time, update_by, update_time, create_site, update_site
|
2024-10-24 05:04:26 +00:00
|
|
|
from emis_commission_profit a
|
|
|
|
|
where a.id = #{id}
|
|
|
|
|
</select>
|
2024-10-24 09:00:30 +00:00
|
|
|
|
2024-10-24 05:04:26 +00:00
|
|
|
<insert id="insertEmisCommissionProfit" parameterType="EmisCommissionProfit" useGeneratedKeys="true" keyProperty="id">
|
|
|
|
|
insert into emis_commission_profit
|
|
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
|
<if test="id != null">id,</if>
|
|
|
|
|
<if test="profitNo != null and profitNo != ''">profit_no,</if>
|
|
|
|
|
<if test="empCode != null and empCode != ''">emp_code,</if>
|
|
|
|
|
<if test="empName != null and empName != ''">emp_name,</if>
|
2024-10-24 09:00:30 +00:00
|
|
|
<if test="billMonth != null and billMonth != ''">bill_month,</if>
|
|
|
|
|
<if test="money != null">money,</if>
|
|
|
|
|
<if test="realMoney != null">real_money,</if>
|
|
|
|
|
<if test="payedMoney != null">payed_money,</if>
|
2024-10-24 05:04:26 +00:00
|
|
|
<if test="blConfirmCenter != null and blConfirmCenter != ''">bl_confirm_center,</if>
|
|
|
|
|
<if test="confirmCenterDate != null">confirm_center_date,</if>
|
|
|
|
|
<if test="confirmCenterNote != null and confirmCenterNote != ''">confirm_center_note,</if>
|
|
|
|
|
<if test="confirmCenterManCode != null and confirmCenterManCode != ''">confirm_center_man_code,</if>
|
|
|
|
|
<if test="confirmCenterCode != null and confirmCenterCode != ''">confirm_center_code,</if>
|
|
|
|
|
<if test="blConfirmSite != null and blConfirmSite != ''">bl_confirm_site,</if>
|
|
|
|
|
<if test="confirmSiteDate != null">confirm_site_date,</if>
|
|
|
|
|
<if test="confirmSiteManCode != null and confirmSiteManCode != ''">confirm_site_man_code,</if>
|
|
|
|
|
<if test="confirmSiteNote != null and confirmSiteNote != ''">confirm_site_note,</if>
|
|
|
|
|
<if test="confirmSiteCode != null and confirmSiteCode != ''">confirm_site_code,</if>
|
|
|
|
|
<if test="remark != null and remark != ''">remark,</if>
|
|
|
|
|
<if test="delFlag != null and delFlag != ''">del_flag,</if>
|
|
|
|
|
<if test="createBy != null and createBy != ''">create_by,</if>
|
|
|
|
|
<if test="createTime != null">create_time,</if>
|
|
|
|
|
<if test="updateBy != null and updateBy != ''">update_by,</if>
|
|
|
|
|
<if test="updateTime != null">update_time,</if>
|
|
|
|
|
<if test="createSite != null and createSite != ''">create_site,</if>
|
|
|
|
|
<if test="updateSite != null and updateSite != ''">update_site,</if>
|
2024-10-24 09:00:30 +00:00
|
|
|
</trim>
|
2024-10-24 05:04:26 +00:00
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
|
<if test="id != null">#{id},</if>
|
|
|
|
|
<if test="profitNo != null and profitNo != ''">#{profitNo},</if>
|
|
|
|
|
<if test="empCode != null and empCode != ''">#{empCode},</if>
|
|
|
|
|
<if test="empName != null and empName != ''">#{empName},</if>
|
2024-10-24 09:00:30 +00:00
|
|
|
<if test="billMonth != null and billMonth != ''">#{billMonth},</if>
|
|
|
|
|
<if test="money != null">#{money},</if>
|
|
|
|
|
<if test="realMoney != null">#{realMoney},</if>
|
|
|
|
|
<if test="payedMoney != null">#{payedMoney},</if>
|
2024-10-24 05:04:26 +00:00
|
|
|
<if test="blConfirmCenter != null and blConfirmCenter != ''">#{blConfirmCenter},</if>
|
|
|
|
|
<if test="confirmCenterDate != null">#{confirmCenterDate},</if>
|
|
|
|
|
<if test="confirmCenterNote != null and confirmCenterNote != ''">#{confirmCenterNote},</if>
|
|
|
|
|
<if test="confirmCenterManCode != null and confirmCenterManCode != ''">#{confirmCenterManCode},</if>
|
|
|
|
|
<if test="confirmCenterCode != null and confirmCenterCode != ''">#{confirmCenterCode},</if>
|
|
|
|
|
<if test="blConfirmSite != null and blConfirmSite != ''">#{blConfirmSite},</if>
|
|
|
|
|
<if test="confirmSiteDate != null">#{confirmSiteDate},</if>
|
|
|
|
|
<if test="confirmSiteManCode != null and confirmSiteManCode != ''">#{confirmSiteManCode},</if>
|
|
|
|
|
<if test="confirmSiteNote != null and confirmSiteNote != ''">#{confirmSiteNote},</if>
|
|
|
|
|
<if test="confirmSiteCode != null and confirmSiteCode != ''">#{confirmSiteCode},</if>
|
|
|
|
|
<if test="remark != null and remark != ''">#{remark},</if>
|
|
|
|
|
<if test="delFlag != null and delFlag != ''">#{delFlag},</if>
|
|
|
|
|
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
|
|
|
|
<if test="createTime != null">#{createTime},</if>
|
|
|
|
|
<if test="updateBy != null and updateBy != ''">#{updateBy},</if>
|
|
|
|
|
<if test="updateTime != null">#{updateTime},</if>
|
|
|
|
|
<if test="createSite != null and createSite != ''">#{createSite},</if>
|
|
|
|
|
<if test="updateSite != null and updateSite != ''">#{updateSite},</if>
|
2024-10-24 09:00:30 +00:00
|
|
|
</trim>
|
2024-10-24 05:04:26 +00:00
|
|
|
</insert>
|
|
|
|
|
|
|
|
|
|
<update id="updateEmisCommissionProfit" parameterType="EmisCommissionProfit">
|
|
|
|
|
update emis_commission_profit
|
|
|
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
|
|
|
<if test="profitNo != null and profitNo != ''">profit_no = #{profitNo},</if>
|
|
|
|
|
<if test="empCode != null and empCode != ''">emp_code = #{empCode},</if>
|
|
|
|
|
<if test="empName != null and empName != ''">emp_name = #{empName},</if>
|
2024-10-24 09:00:30 +00:00
|
|
|
<if test="billMonth != null and billMonth != ''">bill_month = #{billMonth},</if>
|
|
|
|
|
<if test="money != null">money = #{money},</if>
|
|
|
|
|
<if test="realMoney != null">real_money = #{realMoney},</if>
|
|
|
|
|
<if test="payedMoney != null">payed_money = #{payedMoney},</if>
|
2024-10-24 05:04:26 +00:00
|
|
|
<if test="blConfirmCenter != null and blConfirmCenter != ''">bl_confirm_center = #{blConfirmCenter},</if>
|
|
|
|
|
<if test="confirmCenterDate != null">confirm_center_date = #{confirmCenterDate},</if>
|
|
|
|
|
<if test="confirmCenterNote != null and confirmCenterNote != ''">confirm_center_note = #{confirmCenterNote},</if>
|
|
|
|
|
<if test="confirmCenterManCode != null and confirmCenterManCode != ''">confirm_center_man_code = #{confirmCenterManCode},</if>
|
|
|
|
|
<if test="confirmCenterCode != null and confirmCenterCode != ''">confirm_center_code = #{confirmCenterCode},</if>
|
|
|
|
|
<if test="blConfirmSite != null and blConfirmSite != ''">bl_confirm_site = #{blConfirmSite},</if>
|
|
|
|
|
<if test="confirmSiteDate != null">confirm_site_date = #{confirmSiteDate},</if>
|
|
|
|
|
<if test="confirmSiteManCode != null and confirmSiteManCode != ''">confirm_site_man_code = #{confirmSiteManCode},</if>
|
|
|
|
|
<if test="confirmSiteNote != null and confirmSiteNote != ''">confirm_site_note = #{confirmSiteNote},</if>
|
|
|
|
|
<if test="confirmSiteCode != null and confirmSiteCode != ''">confirm_site_code = #{confirmSiteCode},</if>
|
|
|
|
|
<if test="remark != null and remark != ''">remark = #{remark},</if>
|
|
|
|
|
<if test="delFlag != null and delFlag != ''">del_flag = #{delFlag},</if>
|
|
|
|
|
<if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
|
|
|
|
|
<if test="createTime != null">create_time = #{createTime},</if>
|
|
|
|
|
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
|
|
|
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
|
|
|
|
<if test="createSite != null and createSite != ''">create_site = #{createSite},</if>
|
|
|
|
|
<if test="updateSite != null and updateSite != ''">update_site = #{updateSite},</if>
|
|
|
|
|
</trim>
|
|
|
|
|
where id = #{id}
|
|
|
|
|
</update>
|
|
|
|
|
|
2024-11-14 15:18:17 +00:00
|
|
|
<update id="updateProfitMoney" parameterType="EmisCommissionProfit">
|
|
|
|
|
update emis_commission_profit set money = #{money} where emp_name = #{empName} and bill_month = #{billMonth}
|
|
|
|
|
</update>
|
|
|
|
|
|
2024-10-24 05:04:26 +00:00
|
|
|
<delete id="deleteEmisCommissionProfitById" parameterType="Long">
|
2024-11-14 15:18:17 +00:00
|
|
|
update emis_commission_profit set del_flag='1' where id = #{id}
|
2024-10-24 05:04:26 +00:00
|
|
|
</delete>
|
|
|
|
|
|
|
|
|
|
<delete id="deleteEmisCommissionProfitByIds" parameterType="String">
|
2024-11-14 15:18:17 +00:00
|
|
|
update emis_commission_profit set del_flag='1' where id in
|
2024-10-24 05:04:26 +00:00
|
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
|
|
#{id}
|
|
|
|
|
</foreach>
|
|
|
|
|
</delete>
|
|
|
|
|
</mapper>
|