|
|
|
@ -0,0 +1,73 @@
|
|
|
|
|
<?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.chanko.yunxi.mes.module.heli.dal.mysql.storagelog.StorageLogNowMapper">
|
|
|
|
|
|
|
|
|
|
<!--
|
|
|
|
|
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
|
|
|
|
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
|
|
|
|
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
|
|
|
|
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
|
|
|
|
-->
|
|
|
|
|
<resultMap id="StorageLogAllDO" type="com.chanko.yunxi.mes.module.heli.dal.dataobject.storagelogAll.StorageLogAllDO">
|
|
|
|
|
<result property="id" column="id"/>
|
|
|
|
|
<result property="stockId" column="stock_id"/>
|
|
|
|
|
<result property="matId" column="mat_id"/>
|
|
|
|
|
<result property="whId" column="wh_id"/>
|
|
|
|
|
<result property="rgId" column="rg_id"/>
|
|
|
|
|
<result property="pnId" column="pn_id"/>
|
|
|
|
|
<result property="storageOkQty" column="storage_ok_qty"/>
|
|
|
|
|
<result property="lotNo" column="lotNo"/>
|
|
|
|
|
<result property="stockNo" column="stock_no"/>
|
|
|
|
|
<result property="stockType" column="stock_type"/>
|
|
|
|
|
<result property="headerNo" column="header_no"/>
|
|
|
|
|
<result property="matName" column="mat_name"/>
|
|
|
|
|
<result property="matCode" column="mat_code"/>
|
|
|
|
|
<result property="matType" column="mat_type"/>
|
|
|
|
|
<result property="whName" column="wh_name"/>
|
|
|
|
|
<result property="rgName" column="rg_name"/>
|
|
|
|
|
<result property="pnName" column="pn_name"/>
|
|
|
|
|
</resultMap>
|
|
|
|
|
<select id="selectNoZero"
|
|
|
|
|
parameterType="com.chanko.yunxi.mes.module.heli.controller.admin.storagelog.vo.StorageNowAllReqVO"
|
|
|
|
|
resultType="com.chanko.yunxi.mes.module.heli.dal.dataobject.storagelogNow.StorageLogNowDO">
|
|
|
|
|
select * from v_storage_material_now
|
|
|
|
|
<where>
|
|
|
|
|
storage_ok_qty>0
|
|
|
|
|
<if test="matCode != null and matCode != ''">
|
|
|
|
|
AND (mat_code like concat('%', #{matCode}, '%') OR mat_name like concat('%', #{matCode}, '%'))
|
|
|
|
|
</if>
|
|
|
|
|
<if test="matType != null and matType != ''">
|
|
|
|
|
AND mat_type = #{matType}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="whId != null and whId != ''">
|
|
|
|
|
AND wh_id = #{whId}
|
|
|
|
|
</if>
|
|
|
|
|
</where>
|
|
|
|
|
</select>
|
|
|
|
|
<select id="selectNowList"
|
|
|
|
|
parameterType="com.chanko.yunxi.mes.module.heli.controller.admin.storagelog.vo.StorageNowAllReqVO"
|
|
|
|
|
resultType="com.chanko.yunxi.mes.module.heli.dal.dataobject.storagelogNow.StorageLogNowDO">
|
|
|
|
|
select * from (
|
|
|
|
|
select * from v_storage_material_now
|
|
|
|
|
union all
|
|
|
|
|
select deleted,id,creator,updater,create_time,update_time,tenant_id,code as mat_code,name as mat_name,
|
|
|
|
|
(select label from system_dict_data where dict_type='heli_material_type' and value= mat.material_type) as
|
|
|
|
|
mat_type,spec as mat_spec,
|
|
|
|
|
(select label from system_dict_data where dict_type='heli_material_unit' and value= mat.unit) as mat_unit,
|
|
|
|
|
brand as mat_brand,'' as wh_id, '' as wh_name,'' as rg_id,'' as rg_name,'' as pn_id,'' as pn_name,''
|
|
|
|
|
lot_no,short_name,0 as storage_ok_qty
|
|
|
|
|
from base_material as mat where not exists(select id from v_storage_material_now where id=mat.id)
|
|
|
|
|
) t
|
|
|
|
|
<where>
|
|
|
|
|
<if test="matCode != null and matCode != ''">
|
|
|
|
|
AND (mat_code like concat('%', #{matCode}, '%') OR mat_name like concat('%', #{matCode}, '%'))
|
|
|
|
|
</if>
|
|
|
|
|
<if test="matType != null and matType != ''">
|
|
|
|
|
AND mat_type = #{matType}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="whId != null and whId != ''">
|
|
|
|
|
AND wh_id = #{whId}
|
|
|
|
|
</if>
|
|
|
|
|
</where>
|
|
|
|
|
</select>
|
|
|
|
|
</mapper>
|