|
@@ -0,0 +1,111 @@
|
|
|
+<?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.jjt.emp.mapper.TwinEmpCalcMapper">
|
|
|
+
|
|
|
+ <resultMap type="TwinEmpCalc" id="TwinEmpCalcResult">
|
|
|
+ <result property="calcId" column="CALC_ID" />
|
|
|
+ <result property="empName" column="EMP_NAME" />
|
|
|
+ <result property="empDate" column="EMP_DATE" />
|
|
|
+ <result property="empTeam" column="EMP_TEAM" />
|
|
|
+ <result property="deviceId" column="DEVICE_ID" />
|
|
|
+ <result property="efficiency" column="EFFICIENCY" />
|
|
|
+ <result property="spec" column="SPEC" />
|
|
|
+ <result property="mick" column="MICK" />
|
|
|
+ <result property="density" column="DENSITY" />
|
|
|
+ <result property="length" column="LENGTH" />
|
|
|
+ <result property="height" column="HEIGHT" />
|
|
|
+ <result property="price" column="PRICE" />
|
|
|
+ <result property="totalPrice" column="TOTAL_PRICE" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="selectTwinEmpCalcVo">
|
|
|
+ select CALC_ID, EMP_NAME, EMP_DATE, EMP_TEAM, DEVICE_ID, EFFICIENCY, SPEC, MICK, DENSITY, LENGTH, HEIGHT, PRICE, TOTAL_PRICE from TWIN_EMP_CALC
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectTwinEmpCalcList" parameterType="TwinEmpCalc" resultMap="TwinEmpCalcResult">
|
|
|
+ <include refid="selectTwinEmpCalcVo"/>
|
|
|
+ <where>
|
|
|
+ <if test="empName != null and empName != ''"> and EMP_NAME like concat('%', #{empName}, '%')</if>
|
|
|
+ <if test="empDate != null "> and EMP_DATE = #{empDate}</if>
|
|
|
+ <if test="empTeam != null and empTeam != ''"> and EMP_TEAM = #{empTeam}</if>
|
|
|
+ <if test="deviceId != null "> and DEVICE_ID = #{deviceId}</if>
|
|
|
+ <if test="efficiency != null "> and EFFICIENCY = #{efficiency}</if>
|
|
|
+ <if test="spec != null and spec != ''"> and SPEC = #{spec}</if>
|
|
|
+ <if test="mick != null "> and MICK = #{mick}</if>
|
|
|
+ <if test="density != null "> and DENSITY = #{density}</if>
|
|
|
+ <if test="length != null "> and LENGTH = #{length}</if>
|
|
|
+ <if test="height != null "> and HEIGHT = #{height}</if>
|
|
|
+ <if test="price != null "> and PRICE = #{price}</if>
|
|
|
+ <if test="totalPrice != null "> and TOTAL_PRICE = #{totalPrice}</if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectTwinEmpCalcByCalcId" parameterType="Long" resultMap="TwinEmpCalcResult">
|
|
|
+ <include refid="selectTwinEmpCalcVo"/>
|
|
|
+ where CALC_ID = #{calcId}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insertTwinEmpCalc" parameterType="TwinEmpCalc" useGeneratedKeys="true" keyProperty="calcId">
|
|
|
+ insert into TWIN_EMP_CALC
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="empName != null">EMP_NAME,</if>
|
|
|
+ <if test="empDate != null">EMP_DATE,</if>
|
|
|
+ <if test="empTeam != null">EMP_TEAM,</if>
|
|
|
+ <if test="deviceId != null">DEVICE_ID,</if>
|
|
|
+ <if test="efficiency != null">EFFICIENCY,</if>
|
|
|
+ <if test="spec != null">SPEC,</if>
|
|
|
+ <if test="mick != null">MICK,</if>
|
|
|
+ <if test="density != null">DENSITY,</if>
|
|
|
+ <if test="length != null">LENGTH,</if>
|
|
|
+ <if test="height != null">HEIGHT,</if>
|
|
|
+ <if test="price != null">PRICE,</if>
|
|
|
+ <if test="totalPrice != null">TOTAL_PRICE,</if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="empName != null">#{empName},</if>
|
|
|
+ <if test="empDate != null">#{empDate},</if>
|
|
|
+ <if test="empTeam != null">#{empTeam},</if>
|
|
|
+ <if test="deviceId != null">#{deviceId},</if>
|
|
|
+ <if test="efficiency != null">#{efficiency},</if>
|
|
|
+ <if test="spec != null">#{spec},</if>
|
|
|
+ <if test="mick != null">#{mick},</if>
|
|
|
+ <if test="density != null">#{density},</if>
|
|
|
+ <if test="length != null">#{length},</if>
|
|
|
+ <if test="height != null">#{height},</if>
|
|
|
+ <if test="price != null">#{price},</if>
|
|
|
+ <if test="totalPrice != null">#{totalPrice},</if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updateTwinEmpCalc" parameterType="TwinEmpCalc">
|
|
|
+ update TWIN_EMP_CALC
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="empName != null">EMP_NAME = #{empName},</if>
|
|
|
+ <if test="empDate != null">EMP_DATE = #{empDate},</if>
|
|
|
+ <if test="empTeam != null">EMP_TEAM = #{empTeam},</if>
|
|
|
+ <if test="deviceId != null">DEVICE_ID = #{deviceId},</if>
|
|
|
+ <if test="efficiency != null">EFFICIENCY = #{efficiency},</if>
|
|
|
+ <if test="spec != null">SPEC = #{spec},</if>
|
|
|
+ <if test="mick != null">MICK = #{mick},</if>
|
|
|
+ <if test="density != null">DENSITY = #{density},</if>
|
|
|
+ <if test="length != null">LENGTH = #{length},</if>
|
|
|
+ <if test="height != null">HEIGHT = #{height},</if>
|
|
|
+ <if test="price != null">PRICE = #{price},</if>
|
|
|
+ <if test="totalPrice != null">TOTAL_PRICE = #{totalPrice},</if>
|
|
|
+ </trim>
|
|
|
+ where CALC_ID = #{calcId}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="deleteTwinEmpCalcByCalcId" parameterType="Long">
|
|
|
+ delete from TWIN_EMP_CALC where CALC_ID = #{calcId}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deleteTwinEmpCalcByCalcIds" parameterType="String">
|
|
|
+ delete from TWIN_EMP_CALC where CALC_ID in
|
|
|
+ <foreach item="calcId" collection="array" open="(" separator="," close=")">
|
|
|
+ #{calcId}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+</mapper>
|