You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
138 lines
7.6 KiB
138 lines
7.6 KiB
<?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.ruoyi.stock.mapper.CheckHeadMapper">
|
|
|
|
<resultMap type="CheckHead" id="CheckHeadResult">
|
|
<result property="checkId" column="checkId" />
|
|
<result property="checkMan" column="checkMan" />
|
|
<result property="stockNo" column="stockNo" />
|
|
<result property="stockName" column="stockName" />
|
|
<result property="checkDate" column="checkDate" />
|
|
<result property="cancelFlag" column="cancelFlag" />
|
|
<result property="endFlag" column="endFlag" />
|
|
<result property="endDate" column="endDate" />
|
|
<result property="comfirmFlag" column="comfirmFlag" />
|
|
<result property="itemClass" column="itemClass" />
|
|
<result property="remark" column="remark" />
|
|
<result property="spare1" column="spare1" />
|
|
<result property="spare2" column="spare2" />
|
|
<result property="spare3" column="spare3" />
|
|
<result property="spare4" column="spare4" />
|
|
<result property="spare5" column="spare5" />
|
|
<result property="spare6" column="spare6" />
|
|
</resultMap>
|
|
|
|
<sql id="selectCheckHeadVo">
|
|
select checkId, checkMan, stockNo, stockName, checkDate, cancelFlag, endFlag, endDate, comfirmFlag, itemClass, remark, spare1, spare2, spare3, spare4, spare5, spare6 from check_head
|
|
</sql>
|
|
|
|
<select id="selectCheckHeadList" parameterType="CheckHead" resultMap="CheckHeadResult">
|
|
<include refid="selectCheckHeadVo"/>
|
|
<where>
|
|
<if test="checkId != null and checkId != ''"> and checkId like concat('%', #{checkId}, '%')</if>
|
|
<if test="checkMan != null and checkMan != ''"> and checkMan like concat('%', #{checkMan}, '%')</if>
|
|
<if test="stockNo != null and stockNo != ''"> and stockNo like concat('%', #{stockNo}, '%')</if>
|
|
<if test="stockName != null and stockName != ''"> and stockName like concat('%', #{stockName}, '%')</if>
|
|
<if test="params.beginCheckDate != null and params.beginCheckDate != '' and params.endCheckDate != null and params.endCheckDate != ''"> and checkDate between #{params.beginCheckDate} and #{params.endCheckDate}</if>
|
|
<if test="cancelFlag != null and cancelFlag != ''"> and cancelFlag = #{cancelFlag}</if>
|
|
<if test="endFlag != null and endFlag != ''"> and endFlag = #{endFlag}</if>
|
|
<if test="params.beginEndDate != null and params.beginEndDate != '' and params.endEndDate != null and params.endEndDate != ''"> and endDate between #{params.beginEndDate} and #{params.endEndDate}</if>
|
|
<if test="comfirmFlag != null and comfirmFlag != ''"> and comfirmFlag = #{comfirmFlag}</if>
|
|
<if test="itemClass != null and itemClass != ''"> and itemClass like concat('%', #{itemClass}, '%')</if>
|
|
<if test="spare1 != null and spare1 != ''"> and spare1 = #{spare1}</if>
|
|
<if test="spare2 != null and spare2 != ''"> and spare2 = #{spare2}</if>
|
|
<if test="spare3 != null and spare3 != ''"> and spare3 = #{spare3}</if>
|
|
<if test="spare4 != null and spare4 != ''"> and spare4 = #{spare4}</if>
|
|
<if test="spare5 != null and spare5 != ''"> and spare5 = #{spare5}</if>
|
|
<if test="spare6 != null and spare6 != ''"> and spare6 = #{spare6}</if>
|
|
</where>
|
|
</select>
|
|
|
|
<select id="selectCheckHeadById" parameterType="String" resultMap="CheckHeadResult">
|
|
<include refid="selectCheckHeadVo"/>
|
|
where checkId = #{checkId}
|
|
</select>
|
|
|
|
<insert id="insertCheckHead" parameterType="CheckHead">
|
|
insert into check_head
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="checkId != null and checkId != ''">checkId,</if>
|
|
<if test="checkMan != null">checkMan,</if>
|
|
<if test="stockNo != null">stockNo,</if>
|
|
<if test="stockName != null">stockName,</if>
|
|
<if test="checkDate != null">checkDate,</if>
|
|
<if test="cancelFlag != null">cancelFlag,</if>
|
|
<if test="endFlag != null">endFlag,</if>
|
|
<if test="endDate != null">endDate,</if>
|
|
<if test="comfirmFlag != null">comfirmFlag,</if>
|
|
<if test="itemClass != null">itemClass,</if>
|
|
<if test="remark != null">remark,</if>
|
|
<if test="spare1 != null">spare1,</if>
|
|
<if test="spare2 != null">spare2,</if>
|
|
<if test="spare3 != null">spare3,</if>
|
|
<if test="spare4 != null">spare4,</if>
|
|
<if test="spare5 != null">spare5,</if>
|
|
<if test="spare6 != null">spare6,</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="checkId != null and checkId != ''">#{checkId},</if>
|
|
<if test="checkMan != null">#{checkMan},</if>
|
|
<if test="stockNo != null">#{stockNo},</if>
|
|
<if test="stockName != null">#{stockName},</if>
|
|
<if test="checkDate != null">#{checkDate},</if>
|
|
<if test="cancelFlag != null">#{cancelFlag},</if>
|
|
<if test="endFlag != null">#{endFlag},</if>
|
|
<if test="endDate != null">#{endDate},</if>
|
|
<if test="comfirmFlag != null">#{comfirmFlag},</if>
|
|
<if test="itemClass != null">#{itemClass},</if>
|
|
<if test="remark != null">#{remark},</if>
|
|
<if test="spare1 != null">#{spare1},</if>
|
|
<if test="spare2 != null">#{spare2},</if>
|
|
<if test="spare3 != null">#{spare3},</if>
|
|
<if test="spare4 != null">#{spare4},</if>
|
|
<if test="spare5 != null">#{spare5},</if>
|
|
<if test="spare6 != null">#{spare6},</if>
|
|
</trim>
|
|
</insert>
|
|
|
|
<update id="updateCheckHead" parameterType="CheckHead">
|
|
update check_head
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<if test="checkMan != null">checkMan = #{checkMan},</if>
|
|
<if test="stockNo != null">stockNo = #{stockNo},</if>
|
|
<if test="stockName != null">stockName = #{stockName},</if>
|
|
<if test="checkDate != null">checkDate = #{checkDate},</if>
|
|
<if test="cancelFlag != null">cancelFlag = #{cancelFlag},</if>
|
|
<if test="endFlag != null">endFlag = #{endFlag},</if>
|
|
<if test="endDate != null">endDate = #{endDate},</if>
|
|
<if test="comfirmFlag != null">comfirmFlag = #{comfirmFlag},</if>
|
|
<if test="itemClass != null">itemClass = #{itemClass},</if>
|
|
<if test="remark != null">remark = #{remark},</if>
|
|
<if test="spare1 != null">spare1 = #{spare1},</if>
|
|
<if test="spare2 != null">spare2 = #{spare2},</if>
|
|
<if test="spare3 != null">spare3 = #{spare3},</if>
|
|
<if test="spare4 != null">spare4 = #{spare4},</if>
|
|
<if test="spare5 != null">spare5 = #{spare5},</if>
|
|
<if test="spare6 != null">spare6 = #{spare6},</if>
|
|
</trim>
|
|
where checkId = #{checkId}
|
|
</update>
|
|
|
|
<delete id="deleteCheckHeadById" parameterType="String">
|
|
delete from check_head where checkId = #{checkId}
|
|
</delete>
|
|
|
|
<delete id="deleteCheckHeadByIds" parameterType="String">
|
|
delete from check_head where checkId in
|
|
<foreach item="checkId" collection="array" open="(" separator="," close=")">
|
|
#{checkId}
|
|
</foreach>
|
|
</delete>
|
|
|
|
<select id="selectCountByDay" resultType="Integer">
|
|
select count(*) from check_head where to_days(checkDate) = to_days(now());
|
|
</select>
|
|
|
|
</mapper>
|