|
@@ -0,0 +1,152 @@
|
|
|
|
|
+<?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.lean.mapper.LeanCostMapper">
|
|
|
|
|
+
|
|
|
|
|
+ <resultMap type="LeanCost" id="LeanCostResult">
|
|
|
|
|
+ <result property="costId" column="COST_ID" />
|
|
|
|
|
+ <result property="wsName" column="WS_NAME" />
|
|
|
|
|
+ <result property="costTime" column="COST_TIME" />
|
|
|
|
|
+ <result property="length" column="LENGTH" />
|
|
|
|
|
+ <result property="totalCost" column="TOTAL_COST" />
|
|
|
|
|
+ <result property="laborWage" column="LABOR_WAGE" />
|
|
|
|
|
+ <result property="socialInsurance" column="SOCIAL_INSURANCE" />
|
|
|
|
|
+ <result property="partsRepair" column="PARTS_REPAIR" />
|
|
|
|
|
+ <result property="dyeCost" column="DYE_COST" />
|
|
|
|
|
+ <result property="auxiliaryMaterials" column="AUXILIARY_MATERIALS" />
|
|
|
|
|
+ <result property="waterElectricity" column="WATER_ELECTRICITY" />
|
|
|
|
|
+ <result property="amortizationEngineering" column="AMORTIZATION_ENGINEERING" />
|
|
|
|
|
+ <result property="depreciation" column="DEPRECIATION" />
|
|
|
|
|
+ <result property="otherCost" column="OTHER_COST" />
|
|
|
|
|
+ <result property="costPerMeter" column="COST_PER_METER" />
|
|
|
|
|
+ <result property="costCategory" column="COST_CATEGORY" />
|
|
|
|
|
+ <result property="createBy" column="CREATE_BY" />
|
|
|
|
|
+ <result property="createTime" column="CREATE_TIME" />
|
|
|
|
|
+ <result property="updateBy" column="UPDATE_BY" />
|
|
|
|
|
+ <result property="updateTime" column="UPDATE_TIME" />
|
|
|
|
|
+ <result property="remark" column="REMARK" />
|
|
|
|
|
+ </resultMap>
|
|
|
|
|
+
|
|
|
|
|
+ <sql id="selectLeanCostVo">
|
|
|
|
|
+ select COST_ID, WS_NAME, COST_TIME, LENGTH, TOTAL_COST, LABOR_WAGE, SOCIAL_INSURANCE, PARTS_REPAIR, DYE_COST, AUXILIARY_MATERIALS, WATER_ELECTRICITY, AMORTIZATION_ENGINEERING, DEPRECIATION, OTHER_COST, COST_PER_METER, COST_CATEGORY, CREATE_BY, CREATE_TIME, UPDATE_BY, UPDATE_TIME, REMARK from LEAN_COST
|
|
|
|
|
+ </sql>
|
|
|
|
|
+
|
|
|
|
|
+ <select id="selectLeanCostList" parameterType="LeanCost" resultMap="LeanCostResult">
|
|
|
|
|
+ <include refid="selectLeanCostVo"/>
|
|
|
|
|
+ <where>
|
|
|
|
|
+ <if test="wsName != null and wsName != ''"> and WS_NAME = #{wsName}</if>
|
|
|
|
|
+ <if test="costTime != null "> and COST_TIME = #{costTime}</if>
|
|
|
|
|
+ <if test="length != null "> and LENGTH = #{length}</if>
|
|
|
|
|
+ <if test="totalCost != null "> and TOTAL_COST = #{totalCost}</if>
|
|
|
|
|
+ <if test="laborWage != null "> and LABOR_WAGE = #{laborWage}</if>
|
|
|
|
|
+ <if test="socialInsurance != null "> and SOCIAL_INSURANCE = #{socialInsurance}</if>
|
|
|
|
|
+ <if test="partsRepair != null "> and PARTS_REPAIR = #{partsRepair}</if>
|
|
|
|
|
+ <if test="dyeCost != null "> and DYE_COST = #{dyeCost}</if>
|
|
|
|
|
+ <if test="auxiliaryMaterials != null "> and AUXILIARY_MATERIALS = #{auxiliaryMaterials}</if>
|
|
|
|
|
+ <if test="waterElectricity != null "> and WATER_ELECTRICITY = #{waterElectricity}</if>
|
|
|
|
|
+ <if test="amortizationEngineering != null "> and AMORTIZATION_ENGINEERING = #{amortizationEngineering}</if>
|
|
|
|
|
+ <if test="depreciation != null "> and DEPRECIATION = #{depreciation}</if>
|
|
|
|
|
+ <if test="otherCost != null "> and OTHER_COST = #{otherCost}</if>
|
|
|
|
|
+ <if test="costPerMeter != null "> and COST_PER_METER = #{costPerMeter}</if>
|
|
|
|
|
+ <if test="costCategory != null and costCategory != ''"> and COST_CATEGORY = #{costCategory}</if>
|
|
|
|
|
+ <if test="createBy != null and createBy != ''"> and CREATE_BY = #{createBy}</if>
|
|
|
|
|
+ <if test="createTime != null "> and CREATE_TIME = #{createTime}</if>
|
|
|
|
|
+ <if test="updateBy != null and updateBy != ''"> and UPDATE_BY = #{updateBy}</if>
|
|
|
|
|
+ <if test="updateTime != null "> and UPDATE_TIME = #{updateTime}</if>
|
|
|
|
|
+ <if test="remark != null and remark != ''"> and REMARK = #{remark}</if>
|
|
|
|
|
+ <if test="params.year != null and params.year != ''"> and YEAR(COST_TIME) = #{params.year}</if>
|
|
|
|
|
+ </where>
|
|
|
|
|
+ </select>
|
|
|
|
|
+
|
|
|
|
|
+ <select id="selectLeanCostByCostId" parameterType="Long" resultMap="LeanCostResult">
|
|
|
|
|
+ <include refid="selectLeanCostVo"/>
|
|
|
|
|
+ where COST_ID = #{costId}
|
|
|
|
|
+ </select>
|
|
|
|
|
+
|
|
|
|
|
+ <insert id="insertLeanCost" parameterType="LeanCost" useGeneratedKeys="true" keyProperty="costId">
|
|
|
|
|
+ insert into LEAN_COST
|
|
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
|
+ <if test="wsName != null">WS_NAME,</if>
|
|
|
|
|
+ <if test="costTime != null">COST_TIME,</if>
|
|
|
|
|
+ <if test="length != null">LENGTH,</if>
|
|
|
|
|
+ <if test="totalCost != null">TOTAL_COST,</if>
|
|
|
|
|
+ <if test="laborWage != null">LABOR_WAGE,</if>
|
|
|
|
|
+ <if test="socialInsurance != null">SOCIAL_INSURANCE,</if>
|
|
|
|
|
+ <if test="partsRepair != null">PARTS_REPAIR,</if>
|
|
|
|
|
+ <if test="dyeCost != null">DYE_COST,</if>
|
|
|
|
|
+ <if test="auxiliaryMaterials != null">AUXILIARY_MATERIALS,</if>
|
|
|
|
|
+ <if test="waterElectricity != null">WATER_ELECTRICITY,</if>
|
|
|
|
|
+ <if test="amortizationEngineering != null">AMORTIZATION_ENGINEERING,</if>
|
|
|
|
|
+ <if test="depreciation != null">DEPRECIATION,</if>
|
|
|
|
|
+ <if test="otherCost != null">OTHER_COST,</if>
|
|
|
|
|
+ <if test="costPerMeter != null">COST_PER_METER,</if>
|
|
|
|
|
+ <if test="costCategory != null">COST_CATEGORY,</if>
|
|
|
|
|
+ <if test="createBy != null">CREATE_BY,</if>
|
|
|
|
|
+ <if test="createTime != null">CREATE_TIME,</if>
|
|
|
|
|
+ <if test="updateBy != null">UPDATE_BY,</if>
|
|
|
|
|
+ <if test="updateTime != null">UPDATE_TIME,</if>
|
|
|
|
|
+ <if test="remark != null">REMARK,</if>
|
|
|
|
|
+ </trim>
|
|
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
|
+ <if test="wsName != null">#{wsName},</if>
|
|
|
|
|
+ <if test="costTime != null">#{costTime},</if>
|
|
|
|
|
+ <if test="length != null">#{length},</if>
|
|
|
|
|
+ <if test="totalCost != null">#{totalCost},</if>
|
|
|
|
|
+ <if test="laborWage != null">#{laborWage},</if>
|
|
|
|
|
+ <if test="socialInsurance != null">#{socialInsurance},</if>
|
|
|
|
|
+ <if test="partsRepair != null">#{partsRepair},</if>
|
|
|
|
|
+ <if test="dyeCost != null">#{dyeCost},</if>
|
|
|
|
|
+ <if test="auxiliaryMaterials != null">#{auxiliaryMaterials},</if>
|
|
|
|
|
+ <if test="waterElectricity != null">#{waterElectricity},</if>
|
|
|
|
|
+ <if test="amortizationEngineering != null">#{amortizationEngineering},</if>
|
|
|
|
|
+ <if test="depreciation != null">#{depreciation},</if>
|
|
|
|
|
+ <if test="otherCost != null">#{otherCost},</if>
|
|
|
|
|
+ <if test="costPerMeter != null">#{costPerMeter},</if>
|
|
|
|
|
+ <if test="costCategory != null">#{costCategory},</if>
|
|
|
|
|
+ <if test="createBy != null">#{createBy},</if>
|
|
|
|
|
+ <if test="createTime != null">#{createTime},</if>
|
|
|
|
|
+ <if test="updateBy != null">#{updateBy},</if>
|
|
|
|
|
+ <if test="updateTime != null">#{updateTime},</if>
|
|
|
|
|
+ <if test="remark != null">#{remark},</if>
|
|
|
|
|
+ </trim>
|
|
|
|
|
+ </insert>
|
|
|
|
|
+
|
|
|
|
|
+ <update id="updateLeanCost" parameterType="LeanCost">
|
|
|
|
|
+ update LEAN_COST
|
|
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
|
|
+ <if test="wsName != null">WS_NAME = #{wsName},</if>
|
|
|
|
|
+ <if test="costTime != null">COST_TIME = #{costTime},</if>
|
|
|
|
|
+ <if test="length != null">LENGTH = #{length},</if>
|
|
|
|
|
+ <if test="totalCost != null">TOTAL_COST = #{totalCost},</if>
|
|
|
|
|
+ <if test="laborWage != null">LABOR_WAGE = #{laborWage},</if>
|
|
|
|
|
+ <if test="socialInsurance != null">SOCIAL_INSURANCE = #{socialInsurance},</if>
|
|
|
|
|
+ <if test="partsRepair != null">PARTS_REPAIR = #{partsRepair},</if>
|
|
|
|
|
+ <if test="dyeCost != null">DYE_COST = #{dyeCost},</if>
|
|
|
|
|
+ <if test="auxiliaryMaterials != null">AUXILIARY_MATERIALS = #{auxiliaryMaterials},</if>
|
|
|
|
|
+ <if test="waterElectricity != null">WATER_ELECTRICITY = #{waterElectricity},</if>
|
|
|
|
|
+ <if test="amortizationEngineering != null">AMORTIZATION_ENGINEERING = #{amortizationEngineering},</if>
|
|
|
|
|
+ <if test="depreciation != null">DEPRECIATION = #{depreciation},</if>
|
|
|
|
|
+ <if test="otherCost != null">OTHER_COST = #{otherCost},</if>
|
|
|
|
|
+ <if test="costPerMeter != null">COST_PER_METER = #{costPerMeter},</if>
|
|
|
|
|
+ <if test="costCategory != null">COST_CATEGORY = #{costCategory},</if>
|
|
|
|
|
+ <if test="createBy != null">CREATE_BY = #{createBy},</if>
|
|
|
|
|
+ <if test="createTime != null">CREATE_TIME = #{createTime},</if>
|
|
|
|
|
+ <if test="updateBy != null">UPDATE_BY = #{updateBy},</if>
|
|
|
|
|
+ <if test="updateTime != null">UPDATE_TIME = #{updateTime},</if>
|
|
|
|
|
+ <if test="remark != null">REMARK = #{remark},</if>
|
|
|
|
|
+ </trim>
|
|
|
|
|
+ where COST_ID = #{costId}
|
|
|
|
|
+ </update>
|
|
|
|
|
+
|
|
|
|
|
+ <delete id="deleteLeanCostByCostId" parameterType="Long">
|
|
|
|
|
+ delete from LEAN_COST where COST_ID = #{costId}
|
|
|
|
|
+ </delete>
|
|
|
|
|
+
|
|
|
|
|
+ <delete id="deleteLeanCostByCostIds" parameterType="String">
|
|
|
|
|
+ delete from LEAN_COST where COST_ID in
|
|
|
|
|
+ <foreach item="costId" collection="array" open="(" separator="," close=")">
|
|
|
|
|
+ #{costId}
|
|
|
|
|
+ </foreach>
|
|
|
|
|
+ </delete>
|
|
|
|
|
+</mapper>
|