|
@@ -1,53 +1,66 @@
|
|
<?xml version="1.0" encoding="UTF-8" ?>
|
|
<?xml version="1.0" encoding="UTF-8" ?>
|
|
<!DOCTYPE mapper
|
|
<!DOCTYPE mapper
|
|
-PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
-"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
|
|
|
+ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
+ "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
<mapper namespace="com.jjt.emp.mapper.TwinEmpCalcMapper">
|
|
<mapper namespace="com.jjt.emp.mapper.TwinEmpCalcMapper">
|
|
-
|
|
|
|
|
|
+
|
|
<resultMap type="TwinEmpCalc" id="TwinEmpCalcResult">
|
|
<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" />
|
|
|
|
|
|
+ <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>
|
|
</resultMap>
|
|
|
|
|
|
<sql id="selectTwinEmpCalcVo">
|
|
<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
|
|
|
|
|
|
+ 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>
|
|
</sql>
|
|
|
|
|
|
<select id="selectTwinEmpCalcList" parameterType="TwinEmpCalc" resultMap="TwinEmpCalcResult">
|
|
<select id="selectTwinEmpCalcList" parameterType="TwinEmpCalc" resultMap="TwinEmpCalcResult">
|
|
<include refid="selectTwinEmpCalcVo"/>
|
|
<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>
|
|
|
|
+ <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>
|
|
</where>
|
|
</select>
|
|
</select>
|
|
-
|
|
|
|
|
|
+
|
|
<select id="selectTwinEmpCalcByCalcId" parameterType="Long" resultMap="TwinEmpCalcResult">
|
|
<select id="selectTwinEmpCalcByCalcId" parameterType="Long" resultMap="TwinEmpCalcResult">
|
|
<include refid="selectTwinEmpCalcVo"/>
|
|
<include refid="selectTwinEmpCalcVo"/>
|
|
where CALC_ID = #{calcId}
|
|
where CALC_ID = #{calcId}
|
|
</select>
|
|
</select>
|
|
|
|
|
|
- <insert id="insertTwinEmpCalc" parameterType="TwinEmpCalc" useGeneratedKeys="true" keyProperty="calcId">
|
|
|
|
|
|
+ <insert id="insertTwinEmpCalc" parameterType="TwinEmpCalc">
|
|
insert into TWIN_EMP_CALC
|
|
insert into TWIN_EMP_CALC
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="empName != null">EMP_NAME,</if>
|
|
<if test="empName != null">EMP_NAME,</if>
|
|
@@ -62,7 +75,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
<if test="height != null">HEIGHT,</if>
|
|
<if test="height != null">HEIGHT,</if>
|
|
<if test="price != null">PRICE,</if>
|
|
<if test="price != null">PRICE,</if>
|
|
<if test="totalPrice != null">TOTAL_PRICE,</if>
|
|
<if test="totalPrice != null">TOTAL_PRICE,</if>
|
|
- </trim>
|
|
|
|
|
|
+ </trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="empName != null">#{empName},</if>
|
|
<if test="empName != null">#{empName},</if>
|
|
<if test="empDate != null">#{empDate},</if>
|
|
<if test="empDate != null">#{empDate},</if>
|
|
@@ -76,7 +89,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
<if test="height != null">#{height},</if>
|
|
<if test="height != null">#{height},</if>
|
|
<if test="price != null">#{price},</if>
|
|
<if test="price != null">#{price},</if>
|
|
<if test="totalPrice != null">#{totalPrice},</if>
|
|
<if test="totalPrice != null">#{totalPrice},</if>
|
|
- </trim>
|
|
|
|
|
|
+ </trim>
|
|
</insert>
|
|
</insert>
|
|
|
|
|
|
<update id="updateTwinEmpCalc" parameterType="TwinEmpCalc">
|
|
<update id="updateTwinEmpCalc" parameterType="TwinEmpCalc">
|
|
@@ -99,13 +112,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
</update>
|
|
</update>
|
|
|
|
|
|
<delete id="deleteTwinEmpCalcByCalcId" parameterType="Long">
|
|
<delete id="deleteTwinEmpCalcByCalcId" parameterType="Long">
|
|
- delete from TWIN_EMP_CALC where CALC_ID = #{calcId}
|
|
|
|
|
|
+ delete
|
|
|
|
+ from TWIN_EMP_CALC
|
|
|
|
+ where CALC_ID = #{calcId}
|
|
</delete>
|
|
</delete>
|
|
|
|
|
|
<delete id="deleteTwinEmpCalcByCalcIds" parameterType="String">
|
|
<delete id="deleteTwinEmpCalcByCalcIds" parameterType="String">
|
|
- delete from TWIN_EMP_CALC where CALC_ID in
|
|
|
|
|
|
+ delete from TWIN_EMP_CALC where CALC_ID in
|
|
<foreach item="calcId" collection="array" open="(" separator="," close=")">
|
|
<foreach item="calcId" collection="array" open="(" separator="," close=")">
|
|
#{calcId}
|
|
#{calcId}
|
|
</foreach>
|
|
</foreach>
|
|
</delete>
|
|
</delete>
|
|
-</mapper>
|
|
|
|
|
|
+ <delete id="deleteTwinEmpCalcByDate">
|
|
|
|
+ delete
|
|
|
|
+ from twin_emp_calc
|
|
|
|
+ where emp_Date = #{date}
|
|
|
|
+ </delete>
|
|
|
|
+
|
|
|
|
+ <select id="selectTwinEmpCalcListByMonth" resultMap="TwinEmpCalcResult">
|
|
|
|
+ <include refid="selectTwinEmpCalcVo"/>
|
|
|
|
+ where FORMAT(EMP_DATE, 'yyyy-MM') = #{month}
|
|
|
|
+ order by DENSITY,EMP_DATE
|
|
|
|
+ </select>
|
|
|
|
+</mapper>
|