|
|
@ -28,10 +28,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
<result property="updateBy" column="update_by" />
|
|
|
|
<result property="updateBy" column="update_by" />
|
|
|
|
<result property="updateTime" column="update_time" />
|
|
|
|
<result property="updateTime" column="update_time" />
|
|
|
|
<result property="factoryCode" column="factory_code" />
|
|
|
|
<result property="factoryCode" column="factory_code" />
|
|
|
|
|
|
|
|
<result property="unitPrice" column="unit_price" />
|
|
|
|
|
|
|
|
<result property="totalPrice" column="total_price" />
|
|
|
|
</resultMap>
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
|
|
|
<sql id="selectEquSpareApplyVo">
|
|
|
|
<sql id="selectEquSpareApplyVo">
|
|
|
|
select apply_id, apply_code, work_code,parent_code,apply_type,spare_code, spare_name, spare_model, spare_quantity, spare_group_line, spare_use_equipment, apply_time, apply_people, apply_approve_people, attr1, attr2, attr3, del_flag, create_by, create_time, update_by, update_time, factory_code from equ_spare_apply
|
|
|
|
select apply_id, apply_code, work_code,parent_code,apply_type,spare_code, spare_name, spare_model, spare_quantity, spare_group_line, spare_use_equipment, apply_time, apply_people, apply_approve_people, attr1, attr2, attr3, del_flag, create_by, create_time, update_by, update_time, factory_code , unit_price , total_price from equ_spare_apply
|
|
|
|
</sql>
|
|
|
|
</sql>
|
|
|
|
|
|
|
|
|
|
|
|
<select id="selectEquSpareApplyList" parameterType="EquSpareApply" resultMap="EquSpareApplyResult">
|
|
|
|
<select id="selectEquSpareApplyList" parameterType="EquSpareApply" resultMap="EquSpareApplyResult">
|
|
|
@ -55,6 +57,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
<if test="attr2 != null and attr2 != ''"> and attr2 = #{attr2}</if>
|
|
|
|
<if test="attr2 != null and attr2 != ''"> and attr2 = #{attr2}</if>
|
|
|
|
<if test="attr3 != null and attr3 != ''"> and attr3 = #{attr3}</if>
|
|
|
|
<if test="attr3 != null and attr3 != ''"> and attr3 = #{attr3}</if>
|
|
|
|
<if test="factoryCode != null and factoryCode != ''"> and factory_code = #{factoryCode}</if>
|
|
|
|
<if test="factoryCode != null and factoryCode != ''"> and factory_code = #{factoryCode}</if>
|
|
|
|
|
|
|
|
<if test="unitPrice != null and unitPrice != ''"> and unit_price = #{unitPrice}</if>
|
|
|
|
|
|
|
|
<if test="totalPrice != null and totalPrice != ''"> and total_price = #{totalPrice}</if>
|
|
|
|
and del_flag = '0'
|
|
|
|
and del_flag = '0'
|
|
|
|
ORDER BY apply_time DESC
|
|
|
|
ORDER BY apply_time DESC
|
|
|
|
</where>
|
|
|
|
</where>
|
|
|
@ -92,6 +96,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
<if test="updateBy != null">update_by,</if>
|
|
|
|
<if test="updateBy != null">update_by,</if>
|
|
|
|
<if test="updateTime != null">update_time,</if>
|
|
|
|
<if test="updateTime != null">update_time,</if>
|
|
|
|
<if test="factoryCode != null">factory_code,</if>
|
|
|
|
<if test="factoryCode != null">factory_code,</if>
|
|
|
|
|
|
|
|
<if test="unitPrice != null">unit_price,</if>
|
|
|
|
|
|
|
|
<if test="totalPrice != null">total_price,</if>
|
|
|
|
</trim>
|
|
|
|
</trim>
|
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
<if test="applyId != null">#{applyId},</if>
|
|
|
|
<if test="applyId != null">#{applyId},</if>
|
|
|
@ -117,6 +123,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
<if test="updateBy != null">#{updateBy},</if>
|
|
|
|
<if test="updateBy != null">#{updateBy},</if>
|
|
|
|
<if test="updateTime != null">#{updateTime},</if>
|
|
|
|
<if test="updateTime != null">#{updateTime},</if>
|
|
|
|
<if test="factoryCode != null">#{factoryCode},</if>
|
|
|
|
<if test="factoryCode != null">#{factoryCode},</if>
|
|
|
|
|
|
|
|
<if test="unitPrice != null">#{unitPrice},</if>
|
|
|
|
|
|
|
|
<if test="totalPrice != null">#{totalPrice},</if>
|
|
|
|
</trim>
|
|
|
|
</trim>
|
|
|
|
</insert>
|
|
|
|
</insert>
|
|
|
|
|
|
|
|
|
|
|
@ -145,6 +153,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
|
|
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
|
|
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
|
|
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
|
|
|
<if test="factoryCode != null">factory_code = #{factoryCode},</if>
|
|
|
|
<if test="factoryCode != null">factory_code = #{factoryCode},</if>
|
|
|
|
|
|
|
|
<if test="unitPrice != null">unit_price = #{unitPrice},</if>
|
|
|
|
|
|
|
|
<if test="totalPrice != null">total_price = #{totalPrice},</if>
|
|
|
|
</trim>
|
|
|
|
</trim>
|
|
|
|
where apply_id = #{applyId}
|
|
|
|
where apply_id = #{applyId}
|
|
|
|
</update>
|
|
|
|
</update>
|
|
|
@ -210,7 +220,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
<select id="getSparePartsCost" resultType="java.math.BigDecimal">
|
|
|
|
<select id="getSparePartsCost" resultType="java.math.BigDecimal">
|
|
|
|
select SUM(a.spare_quantity * w.unit_price)
|
|
|
|
select SUM(a.spare_quantity * w.unit_price)
|
|
|
|
from equ_spare_apply a
|
|
|
|
from equ_spare_apply a
|
|
|
|
left join wms_ods_mate_storage_news_attached w on a.spare_code = w.primary_code
|
|
|
|
left join wms_ods_mate_storage_news_attached w on a.spare_code = w.primary_code
|
|
|
|
where a.work_code = #{orderCode}
|
|
|
|
where a.work_code = #{orderCode}
|
|
|
|
</select>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|