68 lines
3.2 KiB
XML
68 lines
3.2 KiB
XML
|
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||
|
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||
|
|
<mapper namespace="com.bonus.tool.mapper.TbSubPerfMapper">
|
||
|
|
<insert id="addTbSubPerf" useGeneratedKeys="true" keyProperty="id">
|
||
|
|
insert into tb_sub_perf
|
||
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||
|
|
<if test="subId != null and subId != ''">sub_id,</if>
|
||
|
|
<if test="proName != null and proName != ''">pro_name,</if>
|
||
|
|
<if test="consUnit != null ">cons_unit,</if>
|
||
|
|
<if test="startTime != null">start_time,</if>
|
||
|
|
<if test="endTime != null ">end_time,</if>
|
||
|
|
<if test="htRemark != null and htRemark != ''">ht_remark,</if>
|
||
|
|
<if test="money != null ">money,</if>
|
||
|
|
<if test="createTime != null ">create_time,</if>
|
||
|
|
<if test="createUser != null and createUser != ''">create_user,</if>
|
||
|
|
del_flag
|
||
|
|
</trim>
|
||
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||
|
|
<if test="subId != null and subId != ''">#{subId},</if>
|
||
|
|
<if test="proName != null and proName != ''">#{proName},</if>
|
||
|
|
<if test="consUnit != null ">#{consUnit},</if>
|
||
|
|
<if test="startTime != null ">#{startTime},</if>
|
||
|
|
<if test="endTime != null ">#{endTime},</if>
|
||
|
|
<if test="htRemark != null and htRemark != ''">#{htRemark},</if>
|
||
|
|
<if test="money != null ">#{money},</if>
|
||
|
|
0
|
||
|
|
</trim>
|
||
|
|
</insert>
|
||
|
|
<update id="updateTbSubPerf">
|
||
|
|
update tb_company_perf
|
||
|
|
<trim prefix="SET" suffixOverrides=",">
|
||
|
|
<if test="subId != null">sub_id = #{subId},</if>
|
||
|
|
<if test="proName != null">pro_name = #{proName},</if>
|
||
|
|
<if test="consUnit != null">cons_unit = #{consUnit},</if>
|
||
|
|
<if test="startTime != null">start_time = #{startTime},</if>
|
||
|
|
<if test="endTime != null">end_time = #{endTime},</if>
|
||
|
|
<if test="htRemark != null">ht_remark = #{htRemark},</if>
|
||
|
|
<if test="money != null">money = #{money},</if>
|
||
|
|
<if test="updateUser != null">update_user = #{updateUser},</if>
|
||
|
|
update_time = now()
|
||
|
|
</trim>
|
||
|
|
where id = #{id}
|
||
|
|
</update>
|
||
|
|
<delete id="delTbSubPerf">
|
||
|
|
update tb_sub_perf set del_flag = 1 where id = #{id}
|
||
|
|
</delete>
|
||
|
|
|
||
|
|
<select id="getTbSubPerfList" resultType="com.bonus.tool.dto.TbSubPerfVo">
|
||
|
|
select id as id,sub_id as subId,pro_name as proName,cons_unit as consUnit,start_time as startTime,
|
||
|
|
end_time as endTime,ht_remark as htRemark,money as money
|
||
|
|
from tb_sub_perf where del_flag=0
|
||
|
|
<if test="proName != '' and proName != null">and pro_name = #{proName}</if>
|
||
|
|
<if test="startTime != null"> and start_time >= STR_TO_DATE(#{startTime}, '%Y-%m-%d')</if>
|
||
|
|
<if test="endTime != null"> and STR_TO_DATE(#{endTime}, '%Y-%m-%d ') >= end_time </if>
|
||
|
|
</select>
|
||
|
|
<select id="getTbSubPerfById" resultType="com.bonus.tool.dto.TbSubPerfVo">
|
||
|
|
select id as id,sub_id as subId,pro_name as proName,cons_unit as consUnit,start_time as startTime,
|
||
|
|
end_time as endTime,ht_remark as htRemark,money as money
|
||
|
|
from tb_sub_perf where id=#{id}
|
||
|
|
</select>
|
||
|
|
<select id="getTbSubPerfByProName" resultType="com.bonus.tool.dto.TbSubPerfVo">
|
||
|
|
select id as id,sub_id as subId,pro_name as proName,cons_unit as consUnit,start_time as startTime,
|
||
|
|
end_time as endTime,ht_remark as htRemark,money as money
|
||
|
|
from tb_sub_perf where pro_name=#{proName} and sub_id=#{subId} and del_flag=0
|
||
|
|
</select>
|
||
|
|
</mapper>
|