126 lines
6.5 KiB
XML
126 lines
6.5 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.xdadan.erp.emis.mapper.EmisSalesMonthlyReviewMapper">
|
|
<!-- 结果映射 -->
|
|
<resultMap id="EmisSalesMonthlyReviewResult" type="com.xdadan.erp.emis.domain.EmisSalesMonthlyReview" extends="com.xdadan.erp.emis.mapper.EmisBaseMapper.EmisBaseResult">
|
|
<result property="id" column="id" />
|
|
<result property="employeeName" column="employee_name" />
|
|
<result property="department" column="department" />
|
|
<result property="position" column="position" />
|
|
<result property="entryDate" column="entry_date" />
|
|
<result property="reviewMonth" column="review_month" />
|
|
<result property="score" column="score" />
|
|
</resultMap>
|
|
|
|
<!-- 查询销售月评登记 -->
|
|
<select id="selectEmisSalesMonthlyReviewById" resultMap="EmisSalesMonthlyReviewResult">
|
|
SELECT * FROM emis_sales_monthly_review WHERE id = #{id} AND del_flag = 0
|
|
</select>
|
|
|
|
<!-- 查询销售月评登记列表 -->
|
|
<select id="selectEmisSalesMonthlyReviewList" resultMap="EmisSalesMonthlyReviewResult">
|
|
SELECT * FROM emis_sales_monthly_review
|
|
<where>
|
|
del_flag = 0
|
|
<if test="employeeName != null and employeeName != ''">
|
|
AND employee_name LIKE CONCAT('%', #{employeeName}, '%')
|
|
</if>
|
|
<if test="department != null and department != ''">
|
|
AND department LIKE CONCAT('%', #{department}, '%')
|
|
</if>
|
|
<if test="position != null and position != ''">
|
|
AND position LIKE CONCAT('%', #{position}, '%')
|
|
</if>
|
|
<if test="reviewMonth != null and reviewMonth != ''">
|
|
AND review_month = #{reviewMonth}
|
|
</if>
|
|
<if test="params.beginScore != null and params.beginScore != ''">
|
|
AND score >= #{params.beginScore}
|
|
</if>
|
|
<if test="params.endScore != null and params.endScore != ''">
|
|
AND score <= #{params.endScore}
|
|
</if>
|
|
</where>
|
|
ORDER BY review_month,create_time DESC, employee_name ASC
|
|
</select>
|
|
|
|
<!-- 新增销售月评登记 -->
|
|
<insert id="insertEmisSalesMonthlyReview" parameterType="com.xdadan.erp.emis.domain.EmisSalesMonthlyReview" useGeneratedKeys="true" keyProperty="id">
|
|
INSERT INTO emis_sales_monthly_review
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="employeeName != null and employeeName != ''">employee_name,</if>
|
|
<if test="department != null and department != ''">department,</if>
|
|
<if test="position != null and position != ''">position,</if>
|
|
<if test="entryDate != null">entry_date,</if>
|
|
<if test="reviewMonth != null and reviewMonth != ''">review_month,</if>
|
|
<if test="score != null">score,</if>
|
|
<if test="remark != null and remark != ''">remark,</if>
|
|
<if test="createBy != null and createBy != ''">create_by,</if>
|
|
<if test="createTime != null">create_time,</if>
|
|
<if test="createSite != null and createSite != ''">create_site,</if>
|
|
<if test="updateBy != null and updateBy != ''">update_by,</if>
|
|
<if test="updateTime != null">update_time,</if>
|
|
<if test="updateSite != null and updateSite != ''">update_site,</if>
|
|
<if test="delFlag != null">del_flag,</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="employeeName != null and employeeName != ''">#{employeeName},</if>
|
|
<if test="department != null and department != ''">#{department},</if>
|
|
<if test="position != null and position != ''">#{position},</if>
|
|
<if test="entryDate != null">#{entryDate},</if>
|
|
<if test="reviewMonth != null and reviewMonth != ''">#{reviewMonth},</if>
|
|
<if test="score != null">#{score},</if>
|
|
<if test="remark != null and remark != ''">#{remark},</if>
|
|
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
|
<if test="createTime != null">#{createTime},</if>
|
|
<if test="createSite != null and createSite != ''">#{createSite},</if>
|
|
<if test="updateBy != null and updateBy != ''">#{updateBy},</if>
|
|
<if test="updateTime != null">#{updateTime},</if>
|
|
<if test="updateSite != null and updateSite != ''">#{updateSite},</if>
|
|
<if test="delFlag != null">#{delFlag},</if>
|
|
</trim>
|
|
</insert>
|
|
|
|
<!-- 修改销售月评登记 -->
|
|
<update id="updateEmisSalesMonthlyReview" parameterType="com.xdadan.erp.emis.domain.EmisSalesMonthlyReview">
|
|
UPDATE emis_sales_monthly_review
|
|
<set>
|
|
<if test="employeeName != null">employee_name = #{employeeName},</if>
|
|
<if test="department != null">department = #{department},</if>
|
|
<if test="position != null">position = #{position},</if>
|
|
<if test="entryDate != null">entry_date = #{entryDate},</if>
|
|
<if test="reviewMonth != null">review_month = #{reviewMonth},</if>
|
|
<if test="score != null">score = #{score},</if>
|
|
<if test="remark != null">remark = #{remark},</if>
|
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
|
<if test="updateSite != null">update_site = #{updateSite},</if>
|
|
</set>
|
|
WHERE id = #{id} AND del_flag = 0
|
|
</update>
|
|
|
|
<!-- 软删除销售月评登记 -->
|
|
<update id="deleteEmisSalesMonthlyReviewById" parameterType="Long">
|
|
UPDATE emis_sales_monthly_review SET del_flag = 1 WHERE id = #{id}
|
|
</update>
|
|
|
|
<!-- 批量软删除销售月评登记 -->
|
|
<update id="deleteEmisSalesMonthlyReviewByIds" parameterType="Long[]">
|
|
UPDATE emis_sales_monthly_review SET del_flag = 1 WHERE id IN
|
|
<foreach collection="array" item="id" open="(" separator="," close=")">
|
|
#{id}
|
|
</foreach>
|
|
</update>
|
|
|
|
<!-- 唯一性校验 -->
|
|
<select id="checkUnique" resultMap="EmisSalesMonthlyReviewResult">
|
|
SELECT * FROM emis_sales_monthly_review
|
|
WHERE employee_name = #{employeeName}
|
|
AND position = #{position}
|
|
AND department = #{department}
|
|
AND review_month = #{reviewMonth}
|
|
AND del_flag = 0
|
|
<if test="id != null">AND id != #{id}</if>
|
|
LIMIT 1
|
|
</select>
|
|
</mapper> |