|
@@ -1,121 +1,83 @@
|
|
|
<?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">
|
|
|
+ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
+ "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
<mapper namespace="com.dgtly.order.mapper.SalesOrderBaseMapper">
|
|
|
-
|
|
|
+
|
|
|
<resultMap type="SalesOrderBase" id="SalesOrderBaseResult">
|
|
|
- <result property="id" column="id" />
|
|
|
- <result property="createBy" column="create_by" />
|
|
|
- <result property="createTime" column="create_time" />
|
|
|
- <result property="updateBy" column="update_by" />
|
|
|
- <result property="updateTime" column="update_time" />
|
|
|
- <result property="isDelete" column="is_delete" />
|
|
|
- <result property="orderNumber" column="order_number" />
|
|
|
- <result property="orderCreationTime" column="order_creation_time" />
|
|
|
- <result property="confirmBy" column="confirm_by" />
|
|
|
- <result property="expectedTime" column="expected_time" />
|
|
|
- <result property="belongTo" column="belong_to" />
|
|
|
- <result property="expectedTimeNotice" column="expected_time_notice" />
|
|
|
+ <result property="id" column="id"/>
|
|
|
+ <result property="createBy" column="create_by"/>
|
|
|
+ <result property="createTime" column="create_time"/>
|
|
|
+ <result property="updateBy" column="update_by"/>
|
|
|
+ <result property="updateTime" column="update_time"/>
|
|
|
+ <result property="isDelete" column="is_delete"/>
|
|
|
+ <result property="orderNumber" column="order_number"/>
|
|
|
+ <result property="orderCreationTime" column="order_creation_time"/>
|
|
|
+ <result property="confirmBy" column="confirm_by"/>
|
|
|
+ <result property="expectedTime" column="expected_time"/>
|
|
|
+ <result property="belongTo" column="belong_to"/>
|
|
|
+ <result property="expectedTimeNotice" column="expected_time_notice"/>
|
|
|
|
|
|
</resultMap>
|
|
|
|
|
|
<sql id="selectSalesOrderBaseVo">
|
|
|
- SELECT
|
|
|
- s.id,
|
|
|
- s.create_by,
|
|
|
- s.create_time,
|
|
|
- s.update_by,
|
|
|
- s.update_time,
|
|
|
- s.is_delete,
|
|
|
- s.order_number,
|
|
|
- s.order_creation_time,
|
|
|
- s.confirm_by,
|
|
|
- s.expected_time,
|
|
|
- s.belong_to,
|
|
|
- s.expected_time_notice,
|
|
|
- CustomerCode,
|
|
|
- CustomerName
|
|
|
- FROM
|
|
|
- sales_order_base s
|
|
|
- LEFT JOIN data_master_customer d ON d.CustomerCode = s.belong_to
|
|
|
+ SELECT s.id,
|
|
|
+ s.create_by,
|
|
|
+ s.create_time,
|
|
|
+ s.update_by,
|
|
|
+ s.update_time,
|
|
|
+ s.is_delete,
|
|
|
+ s.order_number,
|
|
|
+ s.order_creation_time,
|
|
|
+ s.confirm_by,
|
|
|
+ s.expected_time,
|
|
|
+ s.belong_to,
|
|
|
+ s.expected_time_notice,
|
|
|
+ CustomerCode,
|
|
|
+ CustomerName
|
|
|
+ FROM sales_order_base s
|
|
|
+ LEFT JOIN data_master_customer d ON d.CustomerCode = s.belong_to
|
|
|
</sql>
|
|
|
|
|
|
<select id="selectSalesOrderBaseList" parameterType="SalesOrderBase" resultMap="SalesOrderBaseResult">
|
|
|
- <include refid="selectSalesOrderBaseVo"/>
|
|
|
- <where>
|
|
|
- <if test="isDelete != null and isDelete != ''"> and is_delete = #{isDelete}</if>
|
|
|
- <if test="orderNumber != null and orderNumber != ''"> and order_number = #{orderNumber}</if>
|
|
|
- <if test="orderCreationTime != null and orderCreationTime != ''"> and order_creation_time = #{orderCreationTime}</if>
|
|
|
- <if test="confirmBy != null and confirmBy != ''"> and confirm_by = #{confirmBy}</if>
|
|
|
- <if test="expectedTime != null "> and expected_time = #{expectedTime}</if>
|
|
|
- <if test="belongTo != null and belongTo != ''"> and belong_to = #{belongTo}</if>
|
|
|
- <if test="expectedTimeNotice != null and expectedTimeNotice != ''"> and expected_time_notice = #{expectedTimeNotice}</if>
|
|
|
+ SELECT
|
|
|
+ s.create_time,
|
|
|
+ s.order_number,
|
|
|
+ s.confirm_by,
|
|
|
+ s.expected_time,
|
|
|
+ s.expected_time_notice,
|
|
|
+ CustomerCode,
|
|
|
+ CustomerName
|
|
|
+ FROM
|
|
|
+ sales_order_base s
|
|
|
+ LEFT JOIN data_master_customer d ON d.CustomerCode = s.belong_to
|
|
|
+ <where>
|
|
|
+ <if test="customerCode != null and customerCode != ''">and CustomerCode like concat('%',#{customerCode},'%')</if>
|
|
|
+ <if test="customerName != null and customerName != ''">and CustomerName like concat('%',#{customerName},'%')</if>
|
|
|
+ <if test="isDelete != null and isDelete != ''">and is_delete = #{isDelete}</if>
|
|
|
+ <if test="orderNumber != null and orderNumber != ''">and order_number = #{orderNumber}</if>
|
|
|
+ <if test="orderCreationTime != null and orderCreationTime != ''">and order_creation_time =
|
|
|
+ #{orderCreationTime}
|
|
|
+ </if>
|
|
|
+ <if test="confirmBy != null and confirmBy != ''">and confirm_by = #{confirmBy}</if>
|
|
|
+ <if test="expectedTime != null ">and expected_time = #{expectedTime}</if>
|
|
|
+ <if test="belongTo != null and belongTo != ''">and belong_to = #{belongTo}</if>
|
|
|
+ <if test="expectedTimeNotice != null and expectedTimeNotice != ''">and expected_time_notice =
|
|
|
+ #{expectedTimeNotice}
|
|
|
+ </if>
|
|
|
+ <if test="beginCreateTime != null and beginCreateTime != ''"><!-- 开始时间检索 -->
|
|
|
+ and date_format(s.create_time,'%y%m%d') >= date_format(#{beginCreateTime},'%y%m%d')
|
|
|
+ </if>
|
|
|
+ <if test="endCreateTime != null and endCreateTime != ''"><!-- 结束时间检索 -->
|
|
|
+ and date_format(s.create_time,'%y%m%d') <= date_format(#{endCreateTime},'%y%m%d')
|
|
|
+ </if>
|
|
|
</where>
|
|
|
</select>
|
|
|
-
|
|
|
+
|
|
|
<select id="selectSalesOrderBaseById" parameterType="Long" resultMap="SalesOrderBaseResult">
|
|
|
<include refid="selectSalesOrderBaseVo"/>
|
|
|
where id = #{id}
|
|
|
</select>
|
|
|
-
|
|
|
- <!--<insert id="insertSalesOrderBase" parameterType="SalesOrderBase" useGeneratedKeys="true" keyProperty="id">
|
|
|
- insert into sales_order_base
|
|
|
- <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
- <if test="createBy != null and createBy != ''">create_by,</if>
|
|
|
- <if test="createTime != null ">create_time,</if>
|
|
|
- <if test="updateBy != null and updateBy != ''">update_by,</if>
|
|
|
- <if test="updateTime != null ">update_time,</if>
|
|
|
- <if test="isDelete != null and isDelete != ''">is_delete,</if>
|
|
|
- <if test="orderNumber != null and orderNumber != ''">order_number,</if>
|
|
|
- <if test="orderCreationTime != null and orderCreationTime != ''">order_creation_time,</if>
|
|
|
- <if test="confirmBy != null and confirmBy != ''">confirm_by,</if>
|
|
|
- <if test="expectedTime != null ">expected_time,</if>
|
|
|
- <if test="belongTo != null and belongTo != ''">belong_to,</if>
|
|
|
- <if test="expectedTimeNotice != null and expectedTimeNotice != ''">expected_time_notice,</if>
|
|
|
- </trim>
|
|
|
- <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
- <if test="createBy != null and createBy != ''">#{createBy},</if>
|
|
|
- <if test="createTime != null ">#{createTime},</if>
|
|
|
- <if test="updateBy != null and updateBy != ''">#{updateBy},</if>
|
|
|
- <if test="updateTime != null ">#{updateTime},</if>
|
|
|
- <if test="isDelete != null and isDelete != ''">#{isDelete},</if>
|
|
|
- <if test="orderNumber != null and orderNumber != ''">#{orderNumber},</if>
|
|
|
- <if test="orderCreationTime != null and orderCreationTime != ''">#{orderCreationTime},</if>
|
|
|
- <if test="confirmBy != null and confirmBy != ''">#{confirmBy},</if>
|
|
|
- <if test="expectedTime != null ">#{expectedTime},</if>
|
|
|
- <if test="belongTo != null and belongTo != ''">#{belongTo},</if>
|
|
|
- <if test="expectedTimeNotice != null and expectedTimeNotice != ''">#{expectedTimeNotice},</if>
|
|
|
- </trim>
|
|
|
- </insert>
|
|
|
-
|
|
|
- <update id="updateSalesOrderBase" parameterType="SalesOrderBase">
|
|
|
- update sales_order_base
|
|
|
- <trim prefix="SET" suffixOverrides=",">
|
|
|
- <if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
|
|
|
- <if test="createTime != null ">create_time = #{createTime},</if>
|
|
|
- <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
|
|
- <if test="updateTime != null ">update_time = #{updateTime},</if>
|
|
|
- <if test="isDelete != null and isDelete != ''">is_delete = #{isDelete},</if>
|
|
|
- <if test="orderNumber != null and orderNumber != ''">order_number = #{orderNumber},</if>
|
|
|
- <if test="orderCreationTime != null and orderCreationTime != ''">order_creation_time = #{orderCreationTime},</if>
|
|
|
- <if test="confirmBy != null and confirmBy != ''">confirm_by = #{confirmBy},</if>
|
|
|
- <if test="expectedTime != null ">expected_time = #{expectedTime},</if>
|
|
|
- <if test="belongTo != null and belongTo != ''">belong_to = #{belongTo},</if>
|
|
|
- <if test="expectedTimeNotice != null and expectedTimeNotice != ''">expected_time_notice = #{expectedTimeNotice},</if>
|
|
|
- </trim>
|
|
|
- where id = #{id}
|
|
|
- </update>
|
|
|
|
|
|
- <delete id="deleteSalesOrderBaseById" parameterType="Long">
|
|
|
- delete from sales_order_base where id = #{id}
|
|
|
- </delete>
|
|
|
|
|
|
- <delete id="deleteSalesOrderBaseByIds" parameterType="String">
|
|
|
- delete from sales_order_base where id in
|
|
|
- <foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
- #{id}
|
|
|
- </foreach>
|
|
|
- </delete>-->
|
|
|
-
|
|
|
</mapper>
|