|
|
@ -53,7 +53,6 @@ |
|
|
</resultMap> |
|
|
</resultMap> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 字段映射--> |
|
|
<!-- 字段映射--> |
|
|
<resultMap id="materialAndTypeMap" type="com.dreamchaser.depository_manage.entity.Material"> |
|
|
<resultMap id="materialAndTypeMap" type="com.dreamchaser.depository_manage.entity.Material"> |
|
|
<id column="id" property="id" jdbcType="INTEGER"/> |
|
|
<id column="id" property="id" jdbcType="INTEGER"/> |
|
|
@ -74,12 +73,14 @@ |
|
|
<result column="productionPlace" property="productionPlace" jdbcType="VARCHAR"/> |
|
|
<result column="productionPlace" property="productionPlace" jdbcType="VARCHAR"/> |
|
|
<result column="brand" property="brand" jdbcType="VARCHAR"/> |
|
|
<result column="brand" property="brand" jdbcType="VARCHAR"/> |
|
|
<result column="remark" property="remark" jdbcType="VARCHAR"/> |
|
|
<result column="remark" property="remark" jdbcType="VARCHAR"/> |
|
|
<association property="materialType" column="typeId" javaType="com.dreamchaser.depository_manage.entity.MaterialType"> |
|
|
<association property="materialType" column="typeId" |
|
|
|
|
|
javaType="com.dreamchaser.depository_manage.entity.MaterialType"> |
|
|
<id column="id" property="id" jdbcType="INTEGER"/> |
|
|
<id column="id" property="id" jdbcType="INTEGER"/> |
|
|
<result column="tname" property="tname" jdbcType="VARCHAR"/> |
|
|
<result column="tname" property="tname" jdbcType="VARCHAR"/> |
|
|
<result column="introduce" property="introduce" jdbcType="VARCHAR"/> |
|
|
<result column="introduce" property="introduce" jdbcType="VARCHAR"/> |
|
|
</association> |
|
|
</association> |
|
|
<association property="depository" column="depositoryId" javaType="com.dreamchaser.depository_manage.entity.Depository"> |
|
|
<association property="depository" column="depositoryId" |
|
|
|
|
|
javaType="com.dreamchaser.depository_manage.entity.Depository"> |
|
|
<id column="id" property="id" jdbcType="INTEGER"/> |
|
|
<id column="id" property="id" jdbcType="INTEGER"/> |
|
|
<result column="dname" property="dname" jdbcType="VARCHAR"/> |
|
|
<result column="dname" property="dname" jdbcType="VARCHAR"/> |
|
|
<result column="address" property="address" jdbcType="VARCHAR"/> |
|
|
<result column="address" property="address" jdbcType="VARCHAR"/> |
|
|
@ -142,7 +143,6 @@ |
|
|
</sql> |
|
|
</sql> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 表查询字段,用于查询物料与条形码视图--> |
|
|
<!-- 表查询字段,用于查询物料与条形码视图--> |
|
|
<sql id="materialAndBarCode"> |
|
|
<sql id="materialAndBarCode"> |
|
|
id,bmcode,mcode,mid,depositoryId,mname,mtid,version,texture,unit,tname,price,shelfLife |
|
|
id,bmcode,mcode,mid,depositoryId,mname,mtid,version,texture,unit,tname,price,shelfLife |
|
|
@ -218,7 +218,6 @@ |
|
|
</select> |
|
|
</select> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 根据条件参数查询数据列表 --> |
|
|
<!-- 根据条件参数查询数据列表 --> |
|
|
<select id="findMaterialByCondition" resultMap="materialMap" parameterType="map"> |
|
|
<select id="findMaterialByCondition" resultMap="materialMap" parameterType="map"> |
|
|
SELECT |
|
|
SELECT |
|
|
@ -282,7 +281,8 @@ |
|
|
</select> |
|
|
</select> |
|
|
|
|
|
|
|
|
<!-- 根据物料id与生产日期获取对应关系--> |
|
|
<!-- 根据物料id与生产日期获取对应关系--> |
|
|
<select id="findMaterialAndProducedDateByMidAndProducedDate" resultMap="MaterialAndProducedDate" parameterType="map"> |
|
|
<select id="findMaterialAndProducedDateByMidAndProducedDate" resultMap="MaterialAndProducedDate" |
|
|
|
|
|
parameterType="map"> |
|
|
select |
|
|
select |
|
|
<include refid="allColumnsByMaterialAndProducedDate"/> |
|
|
<include refid="allColumnsByMaterialAndProducedDate"/> |
|
|
from materialandproduceddate mp |
|
|
from materialandproduceddate mp |
|
|
@ -625,7 +625,6 @@ |
|
|
</select> |
|
|
</select> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 根据仓库查询物料--> |
|
|
<!-- 根据仓库查询物料--> |
|
|
<select id="findMaterialByDepository" resultMap="InventoryMap" parameterType="map"> |
|
|
<select id="findMaterialByDepository" resultMap="InventoryMap" parameterType="map"> |
|
|
SELECT |
|
|
SELECT |
|
|
@ -701,6 +700,14 @@ |
|
|
</select> |
|
|
</select> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<select id="findMaxMaterialCodeForMt" resultType="string" parameterType="long"> |
|
|
|
|
|
select |
|
|
|
|
|
max(code) |
|
|
|
|
|
from material m |
|
|
|
|
|
where m.type_id = #{oldId} |
|
|
|
|
|
</select> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 根据主键查询数据 --> |
|
|
<!-- 根据主键查询数据 --> |
|
|
<select id="findInventoryByIds" resultMap="InventoryMap" parameterType="list"> |
|
|
<select id="findInventoryByIds" resultMap="InventoryMap" parameterType="list"> |
|
|
SELECT |
|
|
SELECT |
|
|
@ -741,7 +748,8 @@ |
|
|
<!-- 插入数据 --> |
|
|
<!-- 插入数据 --> |
|
|
<insert id="insertMaterial" useGeneratedKeys="true" keyProperty="id"> |
|
|
<insert id="insertMaterial" useGeneratedKeys="true" keyProperty="id"> |
|
|
INSERT INTO material ( |
|
|
INSERT INTO material ( |
|
|
id, depository_id, mname, quantity, price, type_id,code,unit,version,texture,amounts,depositoryCode,producedDate,shelfLife,brand,productionPlace,remark |
|
|
id, depository_id, mname, quantity, price, |
|
|
|
|
|
type_id,code,unit,version,texture,amounts,depositoryCode,producedDate,shelfLife,brand,productionPlace,remark |
|
|
) VALUES ( |
|
|
) VALUES ( |
|
|
#{id}, |
|
|
#{id}, |
|
|
<if test="depositoryId != null"> |
|
|
<if test="depositoryId != null"> |
|
|
@ -879,8 +887,6 @@ |
|
|
</delete> |
|
|
</delete> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<update id="updateMaterialAndProducedDate"> |
|
|
<update id="updateMaterialAndProducedDate"> |
|
|
update materialandproduceddate |
|
|
update materialandproduceddate |
|
|
<set> |
|
|
<set> |
|
|
@ -1027,7 +1033,6 @@ |
|
|
</update> |
|
|
</update> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 根据主键删除数据 --> |
|
|
<!-- 根据主键删除数据 --> |
|
|
<delete id="deleteMaterialById" parameterType="int"> |
|
|
<delete id="deleteMaterialById" parameterType="int"> |
|
|
DELETE FROM material WHERE id = #{id} |
|
|
DELETE FROM material WHERE id = #{id} |
|
|
|