|
|
|
<?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.glxp.api.dao.thrsys.ThrInvOrderMapper">
|
|
|
|
<resultMap id="BaseResultMap" type="com.glxp.api.entity.thrsys.ThrInvOrder">
|
|
|
|
<!--@mbg.generated-->
|
|
|
|
<!--@Table thr_inv_order-->
|
|
|
|
<id column="id" jdbcType="INTEGER" property="id" />
|
|
|
|
<result column="billNo" jdbcType="VARCHAR" property="billNo" />
|
|
|
|
<result column="billDate" jdbcType="TIMESTAMP" property="billDate" />
|
|
|
|
<result column="startDate" jdbcType="TIMESTAMP" property="startDate" />
|
|
|
|
<result column="endDate" jdbcType="TIMESTAMP" property="endDate" />
|
|
|
|
<result column="mainAction" jdbcType="VARCHAR" property="mainAction" />
|
|
|
|
<result column="billType" jdbcType="VARCHAR" property="billType" />
|
|
|
|
<result column="thirdSysFk" jdbcType="VARCHAR" property="thirdSysFk" />
|
|
|
|
<result column="deptCode" jdbcType="VARCHAR" property="deptCode" />
|
|
|
|
<result column="invCode" jdbcType="VARCHAR" property="invCode" />
|
|
|
|
<result column="spaceCode" jdbcType="VARCHAR" property="spaceCode" />
|
|
|
|
<result column="status" jdbcType="TINYINT" property="status" />
|
|
|
|
<result column="createTime" jdbcType="TIMESTAMP" property="createTime" />
|
|
|
|
<result column="createUser" jdbcType="VARCHAR" property="createUser" />
|
|
|
|
<result column="updateTime" jdbcType="TIMESTAMP" property="updateTime" />
|
|
|
|
<result column="updateUser" jdbcType="VARCHAR" property="updateUser" />
|
|
|
|
<result column="remark" jdbcType="VARCHAR" property="remark" />
|
|
|
|
<result column="sourceType" jdbcType="INTEGER" property="sourceType" />
|
|
|
|
<result column="exMsg" jdbcType="VARCHAR" property="exMsg" />
|
|
|
|
<result column="skProject" jdbcType="INTEGER" property="skProject" />
|
|
|
|
</resultMap>
|
|
|
|
<sql id="Base_Column_List">
|
|
|
|
<!--@mbg.generated-->
|
|
|
|
id, billNo, billDate, startDate, endDate, mainAction, billType,thirdSysFk, deptCode, invCode,
|
|
|
|
spaceCode, `status`, createTime, `createUser`, updateTime, updateUser, remark,sourceType,exMsg,skProject
|
|
|
|
</sql>
|
|
|
|
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
|
|
|
<!--@mbg.generated-->
|
|
|
|
select
|
|
|
|
<include refid="Base_Column_List" />
|
|
|
|
from thr_inv_order
|
|
|
|
where id = #{id,jdbcType=INTEGER}
|
|
|
|
</select>
|
|
|
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
|
|
|
<!--@mbg.generated-->
|
|
|
|
delete from thr_inv_order
|
|
|
|
where id = #{id,jdbcType=INTEGER}
|
|
|
|
</delete>
|
|
|
|
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.glxp.api.entity.thrsys.ThrInvOrder" useGeneratedKeys="true">
|
|
|
|
<!--@mbg.generated-->
|
|
|
|
insert into thr_inv_order (billNo, billDate, startDate,
|
|
|
|
endDate, mainAction, billType,thirdSysFk,
|
|
|
|
deptCode, invCode, spaceCode,
|
|
|
|
`status`, createTime, `createUser`,
|
|
|
|
updateTime, updateUser, remark,sourceType,exMsg,skProject
|
|
|
|
)
|
|
|
|
values (#{billNo,jdbcType=VARCHAR}, #{billDate,jdbcType=TIMESTAMP}, #{startDate,jdbcType=TIMESTAMP},
|
|
|
|
#{endDate,jdbcType=TIMESTAMP}, #{mainAction,jdbcType=VARCHAR}, #{billType,jdbcType=VARCHAR},#{thirdSysFk,jdbcType=VARCHAR},
|
|
|
|
#{deptCode,jdbcType=VARCHAR}, #{invCode,jdbcType=VARCHAR}, #{spaceCode,jdbcType=VARCHAR},
|
|
|
|
#{status,jdbcType=TINYINT}, #{createTime,jdbcType=TIMESTAMP}, #{createUser,jdbcType=VARCHAR},
|
|
|
|
#{updateTime,jdbcType=TIMESTAMP}, #{updateUser,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, #{sourceType,jdbcType=INTEGER}
|
|
|
|
, #{exMsg,jdbcType=VARCHAR}, #{skProject,jdbcType=INTEGER}
|
|
|
|
)
|
|
|
|
</insert>
|
|
|
|
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.glxp.api.entity.thrsys.ThrInvOrder" useGeneratedKeys="true">
|
|
|
|
<!--@mbg.generated-->
|
|
|
|
insert into thr_inv_order
|
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
<if test="billNo != null">
|
|
|
|
billNo,
|
|
|
|
</if>
|
|
|
|
<if test="billDate != null">
|
|
|
|
billDate,
|
|
|
|
</if>
|
|
|
|
<if test="startDate != null">
|
|
|
|
startDate,
|
|
|
|
</if>
|
|
|
|
<if test="endDate != null">
|
|
|
|
endDate,
|
|
|
|
</if>
|
|
|
|
<if test="mainAction != null">
|
|
|
|
mainAction,
|
|
|
|
</if>
|
|
|
|
<if test="billType != null">
|
|
|
|
billType,
|
|
|
|
</if>
|
|
|
|
<if test="thirdSysFk != null">
|
|
|
|
thirdSysFk,
|
|
|
|
</if>
|
|
|
|
<if test="deptCode != null">
|
|
|
|
deptCode,
|
|
|
|
</if>
|
|
|
|
<if test="invCode != null">
|
|
|
|
invCode,
|
|
|
|
</if>
|
|
|
|
<if test="spaceCode != null">
|
|
|
|
spaceCode,
|
|
|
|
</if>
|
|
|
|
<if test="status != null">
|
|
|
|
`status`,
|
|
|
|
</if>
|
|
|
|
<if test="createTime != null">
|
|
|
|
createTime,
|
|
|
|
</if>
|
|
|
|
<if test="createUser != null">
|
|
|
|
`createUser`,
|
|
|
|
</if>
|
|
|
|
<if test="updateTime != null">
|
|
|
|
updateTime,
|
|
|
|
</if>
|
|
|
|
<if test="updateUser != null">
|
|
|
|
updateUser,
|
|
|
|
</if>
|
|
|
|
<if test="remark != null">
|
|
|
|
remark,
|
|
|
|
</if>
|
|
|
|
<if test="sourceType != null">
|
|
|
|
sourceType,
|
|
|
|
</if>
|
|
|
|
<if test="exMsg != null">
|
|
|
|
exMsg,
|
|
|
|
</if>
|
|
|
|
<if test="skProject != null">
|
|
|
|
skProject,
|
|
|
|
</if>
|
|
|
|
</trim>
|
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
<if test="billNo != null">
|
|
|
|
#{billNo,jdbcType=VARCHAR},
|
|
|
|
</if>
|
|
|
|
<if test="billDate != null">
|
|
|
|
#{billDate,jdbcType=TIMESTAMP},
|
|
|
|
</if>
|
|
|
|
<if test="startDate != null">
|
|
|
|
#{startDate,jdbcType=TIMESTAMP},
|
|
|
|
</if>
|
|
|
|
<if test="endDate != null">
|
|
|
|
#{endDate,jdbcType=TIMESTAMP},
|
|
|
|
</if>
|
|
|
|
<if test="mainAction != null">
|
|
|
|
#{mainAction,jdbcType=VARCHAR},
|
|
|
|
</if>
|
|
|
|
<if test="billType != null">
|
|
|
|
#{billType,jdbcType=VARCHAR},
|
|
|
|
</if>
|
|
|
|
<if test="thirdSysFk != null">
|
|
|
|
#{thirdSysFk,jdbcType=VARCHAR},
|
|
|
|
</if>
|
|
|
|
<if test="deptCode != null">
|
|
|
|
#{deptCode,jdbcType=VARCHAR},
|
|
|
|
</if>
|
|
|
|
<if test="invCode != null">
|
|
|
|
#{invCode,jdbcType=VARCHAR},
|
|
|
|
</if>
|
|
|
|
<if test="spaceCode != null">
|
|
|
|
#{spaceCode,jdbcType=VARCHAR},
|
|
|
|
</if>
|
|
|
|
<if test="status != null">
|
|
|
|
#{status,jdbcType=TINYINT},
|
|
|
|
</if>
|
|
|
|
<if test="createTime != null">
|
|
|
|
#{createTime,jdbcType=TIMESTAMP},
|
|
|
|
</if>
|
|
|
|
<if test="createUser != null">
|
|
|
|
#{createUser,jdbcType=VARCHAR},
|
|
|
|
</if>
|
|
|
|
<if test="updateTime != null">
|
|
|
|
#{updateTime,jdbcType=TIMESTAMP},
|
|
|
|
</if>
|
|
|
|
<if test="updateUser != null">
|
|
|
|
#{updateUser,jdbcType=VARCHAR},
|
|
|
|
</if>
|
|
|
|
<if test="remark != null">
|
|
|
|
#{remark,jdbcType=VARCHAR},
|
|
|
|
</if>
|
|
|
|
<if test="sourceType != null">
|
|
|
|
#{sourceType,jdbcType=INTEGER},
|
|
|
|
</if>
|
|
|
|
<if test="exMsg != null">
|
|
|
|
#{exMsg,jdbcType=VARCHAR},
|
|
|
|
</if>
|
|
|
|
<if test="skProject != null">
|
|
|
|
#{skProject,jdbcType=INTEGER},
|
|
|
|
</if>
|
|
|
|
</trim>
|
|
|
|
</insert>
|
|
|
|
<update id="updateByPrimaryKeySelective" parameterType="com.glxp.api.entity.thrsys.ThrInvOrder">
|
|
|
|
<!--@mbg.generated-->
|
|
|
|
update thr_inv_order
|
|
|
|
<set>
|
|
|
|
<if test="billNo != null">
|
|
|
|
billNo = #{billNo,jdbcType=VARCHAR},
|
|
|
|
</if>
|
|
|
|
<if test="billDate != null">
|
|
|
|
billDate = #{billDate,jdbcType=TIMESTAMP},
|
|
|
|
</if>
|
|
|
|
<if test="startDate != null">
|
|
|
|
startDate = #{startDate,jdbcType=TIMESTAMP},
|
|
|
|
</if>
|
|
|
|
<if test="endDate != null">
|
|
|
|
endDate = #{endDate,jdbcType=TIMESTAMP},
|
|
|
|
</if>
|
|
|
|
<if test="mainAction != null">
|
|
|
|
mainAction = #{mainAction,jdbcType=VARCHAR},
|
|
|
|
</if>
|
|
|
|
<if test="billType != null">
|
|
|
|
billType = #{billType,jdbcType=VARCHAR},
|
|
|
|
</if>
|
|
|
|
<if test="thirdSysFk != null">
|
|
|
|
thirdSysFk = #{thirdSysFk,jdbcType=VARCHAR},
|
|
|
|
</if>
|
|
|
|
<if test="deptCode != null">
|
|
|
|
deptCode = #{deptCode,jdbcType=VARCHAR},
|
|
|
|
</if>
|
|
|
|
<if test="invCode != null">
|
|
|
|
invCode = #{invCode,jdbcType=VARCHAR},
|
|
|
|
</if>
|
|
|
|
<if test="spaceCode != null">
|
|
|
|
spaceCode = #{spaceCode,jdbcType=VARCHAR},
|
|
|
|
</if>
|
|
|
|
<if test="status != null">
|
|
|
|
`status` = #{status,jdbcType=TINYINT},
|
|
|
|
</if>
|
|
|
|
<if test="createTime != null">
|
|
|
|
createTime = #{createTime,jdbcType=TIMESTAMP},
|
|
|
|
</if>
|
|
|
|
<if test="createUser != null">
|
|
|
|
`createUser` = #{createUser,jdbcType=VARCHAR},
|
|
|
|
</if>
|
|
|
|
<if test="updateTime != null">
|
|
|
|
updateTime = #{updateTime,jdbcType=TIMESTAMP},
|
|
|
|
</if>
|
|
|
|
<if test="updateUser != null">
|
|
|
|
updateUser = #{updateUser,jdbcType=VARCHAR},
|
|
|
|
</if>
|
|
|
|
<if test="remark != null">
|
|
|
|
remark = #{remark,jdbcType=VARCHAR},
|
|
|
|
</if>
|
|
|
|
<if test="sourceType != null">
|
|
|
|
sourceType = #{sourceType,jdbcType=INTEGER},
|
|
|
|
</if>
|
|
|
|
<if test="exMsg != null">
|
|
|
|
exMsg = #{exMsg,jdbcType=VARCHAR},
|
|
|
|
</if>
|
|
|
|
<if test="skProject != null">
|
|
|
|
skProject = #{skProject,jdbcType=INTEGER},
|
|
|
|
</if>
|
|
|
|
</set>
|
|
|
|
where id = #{id,jdbcType=INTEGER}
|
|
|
|
</update>
|
|
|
|
<update id="updateByPrimaryKey" parameterType="com.glxp.api.entity.thrsys.ThrInvOrder">
|
|
|
|
<!--@mbg.generated-->
|
|
|
|
update thr_inv_order
|
|
|
|
set billNo = #{billNo,jdbcType=VARCHAR},
|
|
|
|
billDate = #{billDate,jdbcType=TIMESTAMP},
|
|
|
|
startDate = #{startDate,jdbcType=TIMESTAMP},
|
|
|
|
endDate = #{endDate,jdbcType=TIMESTAMP},
|
|
|
|
mainAction = #{mainAction,jdbcType=VARCHAR},
|
|
|
|
billType = #{billType,jdbcType=VARCHAR},
|
|
|
|
thirdSysFk = #{thirdSysFk,jdbcType=VARCHAR},
|
|
|
|
deptCode = #{deptCode,jdbcType=VARCHAR},
|
|
|
|
invCode = #{invCode,jdbcType=VARCHAR},
|
|
|
|
spaceCode = #{spaceCode,jdbcType=VARCHAR},
|
|
|
|
`status` = #{status,jdbcType=TINYINT},
|
|
|
|
createTime = #{createTime,jdbcType=TIMESTAMP},
|
|
|
|
`createUser` = #{createUser,jdbcType=VARCHAR},
|
|
|
|
updateTime = #{updateTime,jdbcType=TIMESTAMP},
|
|
|
|
updateUser = #{updateUser,jdbcType=VARCHAR},
|
|
|
|
remark = #{remark,jdbcType=VARCHAR},
|
|
|
|
sourceType = #{sourceType,jdbcType=INTEGER},
|
|
|
|
exMsg = #{exMsg,jdbcType=VARCHAR},
|
|
|
|
skProject = #{skProject,jdbcType=INTEGER}
|
|
|
|
where id = #{id,jdbcType=INTEGER}
|
|
|
|
</update>
|
|
|
|
|
|
|
|
<select id="filterThrInvOrder" parameterType="com.glxp.api.req.thrsys.FilterThrInvOrderRequest"
|
|
|
|
resultType="com.glxp.api.entity.thrsys.ThrInvOrder">
|
|
|
|
SELECT thr_inv_order.*
|
|
|
|
FROM thr_inv_order
|
|
|
|
<where>
|
|
|
|
<if test="billNo != '' and billNo != null">
|
|
|
|
AND billNo like concat('%', #{billNo}, '%')
|
|
|
|
</if>
|
|
|
|
<if test="billType != '' and billType != null">
|
|
|
|
AND billType = #{billType}
|
|
|
|
</if>
|
|
|
|
<if test="thirdSysFk != '' and thirdSysFk != null">
|
|
|
|
AND thirdSysFk = #{thirdSysFk}
|
|
|
|
</if>
|
|
|
|
<if test="startDate != null and startDate != ''">
|
|
|
|
<![CDATA[
|
|
|
|
and DATE_FORMAT(billdate, '%Y-%m-%d') >= DATE_FORMAT(#{startDate}, '%Y-%m-%d')
|
|
|
|
]]>
|
|
|
|
</if>
|
|
|
|
<if test="endDate != null and endDate != ''">
|
|
|
|
<![CDATA[
|
|
|
|
and DATE_FORMAT(billdate, '%Y-%m-%d') <= DATE_FORMAT(#{endDate}, '%Y-%m-%d')
|
|
|
|
]]>
|
|
|
|
</if>
|
|
|
|
<if test="sourceType != '' and sourceType != null">
|
|
|
|
AND sourceType = #{sourceType}
|
|
|
|
</if>
|
|
|
|
</where>
|
|
|
|
ORDER BY thr_inv_order.billdate DESC
|
|
|
|
</select>
|
|
|
|
</mapper>
|