|
|
@ -1,38 +1,38 @@ |
|
|
<?xml version="1.0" encoding="UTF-8"?> |
|
|
<?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"> |
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|
|
<mapper namespace="com.gaotao.modules.toolman.dao.ToolTransDetailMapper"> |
|
|
<mapper namespace="com.gaotao.modules.toolman.dao.ToolTransDetailMapper"> |
|
|
<resultMap id="BaseResultMap" type="com.gaotao.modules.toolman.entity.ToolTransDetail"> |
|
|
|
|
|
<!--@mbg.generated--> |
|
|
|
|
|
<!--@Table tool_trans_detail--> |
|
|
|
|
|
<result column="id" jdbcType="INTEGER" property="id" /> |
|
|
|
|
|
<result column="trans_no" jdbcType="VARCHAR" property="transNo" /> |
|
|
|
|
|
<result column="item_no" jdbcType="VARCHAR" property="itemNo" /> |
|
|
|
|
|
<result column="tool_instance_id" jdbcType="VARCHAR" property="toolInstanceId" /> |
|
|
|
|
|
<result column="trans_qty" jdbcType="INTEGER" property="transQty" /> |
|
|
|
|
|
<result column="batch_no" jdbcType="VARCHAR" property="batchNo" /> |
|
|
|
|
|
<result column="ware_house_id" jdbcType="VARCHAR" property="wareHouseId" /> |
|
|
|
|
|
<result column="location_id" jdbcType="VARCHAR" property="locationId" /> |
|
|
|
|
|
<result column="direction" jdbcType="CHAR" property="direction" /> |
|
|
|
|
|
<result column="orderRef1" jdbcType="VARCHAR" property="orderRef1" /> |
|
|
|
|
|
<result column="orderRef2" jdbcType="VARCHAR" property="orderRef2" /> |
|
|
|
|
|
<result column="orderRef3" jdbcType="VARCHAR" property="orderRef3" /> |
|
|
|
|
|
<result column="orderRef4" jdbcType="VARCHAR" property="orderRef4" /> |
|
|
|
|
|
<result column="supplier_id" jdbcType="VARCHAR" property="supplierId" /> |
|
|
|
|
|
<result column="remark" jdbcType="VARCHAR" property="remark" /> |
|
|
|
|
|
<result column="created_by" jdbcType="VARCHAR" property="createdBy" /> |
|
|
|
|
|
<result column="created_date" jdbcType="TIMESTAMP" property="createdDate" /> |
|
|
|
|
|
<result column="update_by" jdbcType="VARCHAR" property="updateBy" /> |
|
|
|
|
|
<result column="updated_date" jdbcType="TIMESTAMP" property="updatedDate" /> |
|
|
|
|
|
<result column="delflag" jdbcType="CHAR" property="delflag" /> |
|
|
|
|
|
<result column="version" jdbcType="INTEGER" property="version" /> |
|
|
|
|
|
</resultMap> |
|
|
|
|
|
<sql id="Base_Column_List"> |
|
|
|
|
|
<!--@mbg.generated--> |
|
|
|
|
|
id, trans_no, item_no, tool_instance_id, trans_qty, batch_no, ware_house_id, location_id, |
|
|
|
|
|
direction, orderRef1, orderRef2, orderRef3, orderRef4, supplier_id, remark, created_by, |
|
|
|
|
|
created_date, update_by, updated_date, delflag, version |
|
|
|
|
|
</sql> |
|
|
|
|
|
<insert id="insertSelective"> |
|
|
|
|
|
|
|
|
<resultMap id="BaseResultMap" type="com.gaotao.modules.toolman.entity.ToolTransDetail"> |
|
|
|
|
|
<!--@mbg.generated--> |
|
|
|
|
|
<!--@Table tool_trans_detail--> |
|
|
|
|
|
<result column="id" jdbcType="INTEGER" property="id"/> |
|
|
|
|
|
<result column="trans_no" jdbcType="VARCHAR" property="transNo"/> |
|
|
|
|
|
<result column="item_no" jdbcType="VARCHAR" property="itemNo"/> |
|
|
|
|
|
<result column="tool_instance_id" jdbcType="VARCHAR" property="toolInstanceId"/> |
|
|
|
|
|
<result column="trans_qty" jdbcType="INTEGER" property="transQty"/> |
|
|
|
|
|
<result column="batch_no" jdbcType="VARCHAR" property="batchNo"/> |
|
|
|
|
|
<result column="ware_house_id" jdbcType="VARCHAR" property="wareHouseId"/> |
|
|
|
|
|
<result column="location_id" jdbcType="VARCHAR" property="locationId"/> |
|
|
|
|
|
<result column="direction" jdbcType="CHAR" property="direction"/> |
|
|
|
|
|
<result column="orderRef1" jdbcType="VARCHAR" property="orderRef1"/> |
|
|
|
|
|
<result column="orderRef2" jdbcType="VARCHAR" property="orderRef2"/> |
|
|
|
|
|
<result column="orderRef3" jdbcType="VARCHAR" property="orderRef3"/> |
|
|
|
|
|
<result column="orderRef4" jdbcType="VARCHAR" property="orderRef4"/> |
|
|
|
|
|
<result column="supplier_id" jdbcType="VARCHAR" property="supplierId"/> |
|
|
|
|
|
<result column="remark" jdbcType="VARCHAR" property="remark"/> |
|
|
|
|
|
<result column="created_by" jdbcType="VARCHAR" property="createdBy"/> |
|
|
|
|
|
<result column="created_date" jdbcType="TIMESTAMP" property="createdDate"/> |
|
|
|
|
|
<result column="update_by" jdbcType="VARCHAR" property="updateBy"/> |
|
|
|
|
|
<result column="updated_date" jdbcType="TIMESTAMP" property="updatedDate"/> |
|
|
|
|
|
<result column="delflag" jdbcType="CHAR" property="delflag"/> |
|
|
|
|
|
<result column="version" jdbcType="INTEGER" property="version"/> |
|
|
|
|
|
</resultMap> |
|
|
|
|
|
<sql id="Base_Column_List"> |
|
|
|
|
|
<!--@mbg.generated--> |
|
|
|
|
|
id, trans_no, item_no, tool_instance_id, trans_qty, batch_no, ware_house_id, location_id, |
|
|
|
|
|
direction, orderRef1, orderRef2, orderRef3, orderRef4, supplier_id, remark, created_by, |
|
|
|
|
|
created_date, update_by, updated_date, delflag, version |
|
|
|
|
|
</sql> |
|
|
|
|
|
<insert id="insertSelective"> |
|
|
<!--@mbg.generated--> |
|
|
<!--@mbg.generated--> |
|
|
INSERT INTO tool_trans_detail |
|
|
INSERT INTO tool_trans_detail |
|
|
<trim prefix="(" suffix=")" suffixOverrides=","> |
|
|
<trim prefix="(" suffix=")" suffixOverrides=","> |
|
|
@ -85,7 +85,7 @@ |
|
|
<if test="transPrice!=null">#{transPrice}</if> |
|
|
<if test="transPrice!=null">#{transPrice}</if> |
|
|
</trim> |
|
|
</trim> |
|
|
</insert> |
|
|
</insert> |
|
|
<insert id="insertList"> |
|
|
|
|
|
|
|
|
<insert id="insertList"> |
|
|
<!--@mbg.generated--> |
|
|
<!--@mbg.generated--> |
|
|
INSERT INTO tool_trans_detail( |
|
|
INSERT INTO tool_trans_detail( |
|
|
id, |
|
|
id, |
|
|
@ -136,7 +136,7 @@ |
|
|
) |
|
|
) |
|
|
</foreach> |
|
|
</foreach> |
|
|
</insert> |
|
|
</insert> |
|
|
<update id="updateById"> |
|
|
|
|
|
|
|
|
<update id="updateById"> |
|
|
<!--@mbg.generated--> |
|
|
<!--@mbg.generated--> |
|
|
update tool_trans_detail |
|
|
update tool_trans_detail |
|
|
<set> |
|
|
<set> |
|
|
@ -207,7 +207,7 @@ |
|
|
</if> |
|
|
</if> |
|
|
</where> |
|
|
</where> |
|
|
</update> |
|
|
</update> |
|
|
<delete id="deleteById"> |
|
|
|
|
|
|
|
|
<delete id="deleteById"> |
|
|
<!--@mbg.generated--> |
|
|
<!--@mbg.generated--> |
|
|
delete from tool_trans_detail |
|
|
delete from tool_trans_detail |
|
|
<where> |
|
|
<where> |
|
|
@ -216,7 +216,7 @@ |
|
|
</if> |
|
|
</if> |
|
|
</where> |
|
|
</where> |
|
|
</delete> |
|
|
</delete> |
|
|
<select id="selectByTransNo" resultMap="BaseResultMap"> |
|
|
|
|
|
|
|
|
<select id="selectByTransNo" resultMap="BaseResultMap"> |
|
|
<!--@mbg.generated--> |
|
|
<!--@mbg.generated--> |
|
|
select |
|
|
select |
|
|
<include refid="Base_Column_List"/> |
|
|
<include refid="Base_Column_List"/> |
|
|
@ -228,14 +228,21 @@ |
|
|
</where> |
|
|
</where> |
|
|
</select> |
|
|
</select> |
|
|
<select id="getToolInstanceIdUseHist" resultMap="BaseResultMap"> |
|
|
<select id="getToolInstanceIdUseHist" resultMap="BaseResultMap"> |
|
|
select C.SupplierName as supplier_name ,A.created_date as deliveryDate,B.created_date as returnDate |
|
|
|
|
|
,CONVERT(varchar(100), A.created_date, 23) as strDeliveryDate |
|
|
|
|
|
,CONVERT(varchar(100), B.created_date, 23) as strReturnDate |
|
|
|
|
|
,B.created_by |
|
|
|
|
|
|
|
|
select C.SupplierName as supplier_name |
|
|
|
|
|
, A.created_date as deliveryDate |
|
|
|
|
|
, B.created_date as returnDate |
|
|
|
|
|
, CONVERT(varchar(100), A.created_date, 23) as strDeliveryDate |
|
|
|
|
|
, CONVERT(varchar(100), B.created_date, 23) as strReturnDate |
|
|
|
|
|
, B.created_by |
|
|
from tool_trans_detail B |
|
|
from tool_trans_detail B |
|
|
left join tool_trans_detail A on A.tool_instance_id = B.tool_instance_id and A.trans_no like 'TW%' |
|
|
|
|
|
|
|
|
left join tool_trans_detail A on A.tool_instance_id = B.tool_instance_id and A.trans_no like 'TW%' |
|
|
and A.tool_instance_id = #{toolInstanceId,jdbcType=VARCHAR} |
|
|
and A.tool_instance_id = #{toolInstanceId,jdbcType=VARCHAR} |
|
|
LEFT JOIN Supplier C on C.supplierID = A.supplier_id |
|
|
|
|
|
|
|
|
LEFT JOIN Supplier C on C.supplierID = A.supplier_id |
|
|
where B.orderRef2 = A.trans_no |
|
|
where B.orderRef2 = A.trans_no |
|
|
</select> |
|
|
|
|
|
|
|
|
</select> |
|
|
|
|
|
<select id="getLocationCount" resultType="java.lang.Integer"> |
|
|
|
|
|
select count(1) |
|
|
|
|
|
from tool_trans_detail |
|
|
|
|
|
where location_id = #{locationId} |
|
|
|
|
|
</select> |
|
|
</mapper> |
|
|
</mapper> |