2024-11-12 10:51:15 +08:00
|
|
|
<?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.bonus.gzgqj.business.bases.mapper.PartInputMapper" >
|
2024-11-12 13:53:41 +08:00
|
|
|
<insert id="addInputData" useGeneratedKeys="true" keyProperty="id">
|
|
|
|
|
insert into t_part_input(
|
|
|
|
|
code,creator,create_time,is_flag,remark,updater,update_time,
|
|
|
|
|
all_price,input_day,input_num,input_user
|
|
|
|
|
)values (#{code},#{creator},now(),#{isFlag},#{remark},#{updater},now(),
|
|
|
|
|
#{allPrice},#{inputDay},#{inputNum},#{inputUser})
|
|
|
|
|
</insert>
|
|
|
|
|
<insert id="addDetails">
|
|
|
|
|
insert into (
|
|
|
|
|
put_id,part_id,part_type,part_name,part_model,part_unit,input_num,part_price,
|
|
|
|
|
total_price,vender_id,vender_name) values
|
|
|
|
|
<foreach collection="list" item="item" separator=",">
|
|
|
|
|
(#{param.id},#{item.partId},#{item.partType},#{item.partName},
|
|
|
|
|
#{item.partModel},#{item.partUnit},#{item.inputNum},#{item.partPrice},
|
|
|
|
|
#{item.totalPrice},#{item.vendId},#{item.vendName})
|
|
|
|
|
</foreach>
|
|
|
|
|
|
|
|
|
|
</insert>
|
2024-11-12 10:51:15 +08:00
|
|
|
<!--分页查询-->
|
|
|
|
|
<select id="findByPage" resultType="com.bonus.gzgqj.business.bases.entity.PartInputVo">
|
|
|
|
|
select tpi.id,tpi.code,tpi.creator,tpi.input_day inputDay,
|
|
|
|
|
tpi.input_num inputNum,tpi.all_price allPrice,tpi.remark,tpi.is_flag isFlag
|
|
|
|
|
from t_part_input tpi
|
|
|
|
|
<where>
|
|
|
|
|
<if test="keyWord!=null and keyWord!=''">
|
|
|
|
|
and (tpi.code like concat('%',#{keyWord},'%') or
|
|
|
|
|
tpi.creator like concat('%',#{keyWord},'%') or
|
|
|
|
|
tpi.input_day like concat('%',#{keyWord},'%') or
|
|
|
|
|
tpi.remark like concat('%',#{keyWord},'%')
|
|
|
|
|
)
|
|
|
|
|
</if>
|
|
|
|
|
<if test="inputDay!=null and inputDay!='' and startDay!=null and endDay!=null ">
|
|
|
|
|
and STR_TO_DATE(tpi.input_day, '%Y-%m-%d') between STR_TO_DATE(#{startDay} ,'%Y-%m-%d') AND STR_TO_DATE(#{endDay},'%Y-%m-%d')
|
|
|
|
|
</if>
|
|
|
|
|
</where>
|
|
|
|
|
</select>
|
2024-11-12 13:53:41 +08:00
|
|
|
<!--入库数量-->
|
|
|
|
|
<select id="getInputNum" resultType="java.lang.Integer">
|
|
|
|
|
select count(1)
|
|
|
|
|
from t_part_input
|
|
|
|
|
where DATE_FORMAT(create_time,'%Y-%m-%d')=CURRENT_DATE
|
|
|
|
|
</select>
|
2024-11-12 10:51:15 +08:00
|
|
|
</mapper>
|