123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275 |
- <?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.zkqy.business.mapper.DetailsOfTheRefuelingPlanSpinningMapper">
- <resultMap type="com.zkqy.business.domain.DetailsOfTheRefuelingPlanSpinning" id="DetailsOfTheRefuelingPlanSpinningResult">
- <result property="id" column="id" />
- <result property="timestampRandomCode" column="timestamp_random_code" />
- <result property="macId" column="mac_id" />
- <result property="machineId" column="machine_id" />
- <result property="productionDigit" column="production_digit" />
- <result property="currentColorCode" column="current_color_code" />
- <result property="currentSpecification" column="current_specification" />
- <result property="currentLotNumber" column="current_lot_number" />
- <result property="startTime" column="start_time" />
- <result property="plannedEndTime" column="planned_end_time" />
- <result property="planStatus" column="plan_status" />
- <result property="number" column="number" />
- <result property="remark" column="remark" />
- <result property="createById" column="create_by_id" />
- <result property="createBy" column="create_by" />
- <result property="updateById" column="update_by_id" />
- <result property="updateBy" column="update_by" />
- <result property="createTime" column="create_time" />
- <result property="updateTime" column="update_time" />
- <result property="productId" column="product_id" />
- <result property="salesmanId" column="salesman_id" />
- <result property="productTypeName" column="productTypeName"/>
- <result property="createById" column="create_by_id" />
- <result property="createBy" column="create_by" />
- <result property="createTime" column="create_time"/>
- <result property="tubeweight" column="tube_weight"/>
- <result property="boxweight" column="box_weight"/>
- <result property="tubecolor" column="tube_color"/>
- </resultMap>
- <sql id="selectDetailsOfTheRefuelingPlanSpinningVo">
- select id, timestamp_random_code, mac_id,machine_id, production_digit, current_color_code, current_specification, current_lot_number, start_time, planned_end_time,
- plan_status, number, remark, create_by_id, create_by, update_by, update_by, create_time, update_time,tube_weight,box_weight,tube_color,
- product_id, salesman_id,productTypeName,create_by_id,create_by,create_time
- from huaxian.details_of_the_refueling_plan_spinning
- </sql>
- <select id="selectDetailsOfTheRefuelingPlanSpinningList" parameterType="com.zkqy.business.domain.DetailsOfTheRefuelingPlanSpinning" resultMap="DetailsOfTheRefuelingPlanSpinningResult">
- <include refid="selectDetailsOfTheRefuelingPlanSpinningVo"/>
- <where>
- <if test="timestampRandomCode != null and timestampRandomCode != ''"> and timestamp_random_code = #{timestampRandomCode}</if>
- <if test="macId != null and machineId != ''"> and mac_id = #{macId}</if>
- <if test="machineId != null and machineId != ''"> and machine_id = #{machineId}</if>
- <if test="productionDigit != null and productionDigit != ''"> and production_digit = #{productionDigit}</if>
- <if test="currentColorCode != null and currentColorCode != ''"> and current_color_code = #{currentColorCode}</if>
- <if test="currentSpecification != null and currentSpecification != ''"> and current_specification = #{currentSpecification}</if>
- <if test="currentLotNumber != null and currentLotNumber != ''"> and current_lot_number = #{currentLotNumber}</if>
- <if test="startTime != null and startTime != ''"> and start_time = #{startTime}</if>
- <if test="plannedEndTime != null and plannedEndTime != ''"> and planned_end_time = #{plannedEndTime}</if>
- <if test="planStatus != null and planStatus != ''"> and plan_status = #{planStatus}</if>
- <if test="number != null and number != ''"> and number = #{number}</if>
- <if test="createById != null and createById != ''"> and create_by_id = #{createById}</if>
- <if test="createBy != null and createBy != ''"> and create_by like concat('%', #{createby}, '%')</if>
- <if test="updateById != null and updateById != ''"> and update_by_id = #{updateById}</if>
- <if test="updateBy != null and updateBy != ''"> and update_by like concat('%', #{updateby}, '%')</if>
- <if test="productId != null and productId != ''"> and product_id = #{productId}</if>
- <if test="salesmanId != null and salesmanId != ''"> and salesman_id = #{salesmanId}</if>
- and plan_status != 3
- </where>
- </select>
- <select id="selectDetailsOfTheRefuelingPlanSpinningById" parameterType="Long" resultMap="DetailsOfTheRefuelingPlanSpinningResult">
- <include refid="selectDetailsOfTheRefuelingPlanSpinningVo"/>
- where id = #{id}
- </select>
- <select id="selectDetailsOfTheRefuelingPlanSpinningListCount" resultType="java.lang.Integer">
- select count(id) from {DBNAME}.details_of_the_refueling_plan_spinning where plan_status !=2 and plan_status!=3
- </select>
- <select id="getCurrentProductionLineSuperior"
- resultType="com.zkqy.business.domain.DetailsOfTheRefuelingPlanSpinning">
- <include refid="selectDetailsOfTheRefuelingPlanSpinningVo"/>
- <where>
- <if test="id != null and id != ''"> and id != #{id}</if>
- <if test="timestampRandomCode != null and timestampRandomCode != ''"> and timestamp_random_code = #{timestampRandomCode}</if>
- <if test="macId != null and machineId != ''"> and mac_id = #{macId}</if>
- <if test="machineId != null and machineId != ''"> and machine_id = #{machineId}</if>
- <if test="productionDigit != null and productionDigit != ''"> and production_digit = #{productionDigit}</if>
- <if test="currentColorCode != null and currentColorCode != ''"> and current_color_code = #{currentColorCode}</if>
- <if test="currentSpecification != null and currentSpecification != ''"> and current_specification = #{currentSpecification}</if>
- <if test="currentLotNumber != null and currentLotNumber != ''"> and current_lot_number = #{currentLotNumber}</if>
- <if test="startTime != null and startTime != ''"> and start_time = #{startTime}</if>
- <if test="plannedEndTime != null and plannedEndTime != ''"> and planned_end_time = #{plannedEndTime}</if>
- <if test="planStatus != null and planStatus != ''"> and plan_status = #{planStatus}</if>
- <if test="number != null and number != ''"> and number = #{number}</if>
- <if test="createById != null and createById != ''"> and create_by_id = #{createById}</if>
- <if test="createBy != null and createBy != ''"> and create_by like concat('%', #{createBy}, '%')</if>
- <if test="updateById != null and updateById != ''"> and update_by_id = #{updateById}</if>
- <if test="updateBy != null and updateBy!= ''"> and update_by like concat('%', #{updateBy}, '%')</if>
- <if test="productId != null and productId != ''"> and product_id = #{productId}</if>
- <if test="salesmanId != null and salesmanId != ''"> and salesman_id = #{salesmanId}</if>
- </where>
- </select>
- <select id="getIsTheOrderProductProduced"
- parameterType="com.zkqy.business.domain.DetailsOfTheRefuelingPlanSpinning"
- resultType="com.zkqy.business.domain.DetailsOfTheRefuelingPlanSpinning">
- select * from {DBNAME}.details_of_the_refueling_plan_spinning as dotrps
- left join
- {DBNAME}.sale_products as sp
- on dotrps.product_id=sp.id and dotrps.salesman_id=sp.sale_order_no
- where sp.`status`=4 and dotrps.id=#{id}
- </select>
- <select id="getUpdatePlanSpinningInfo"
- resultType="com.zkqy.business.domain.DetailsOfTheRefuelingPlanSpinning">
- select * from {DBNAME}.details_of_the_refueling_plan_spinning as dotrps
- left join
- {DBNAME}.sale_products as sp
- on dotrps.product_id=sp.id and dotrps.salesman_id=sp.sale_order_no
- where sp.`status`!=4 and dotrps.id=#{id}
- </select>
- <insert id="insertDetailsOfTheRefuelingPlanSpinning" parameterType="com.zkqy.business.domain.DetailsOfTheRefuelingPlanSpinning" useGeneratedKeys="true" keyProperty="id">
- insert into {DBNAME}.details_of_the_refueling_plan_spinning
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="timestampRandomCode != null">timestamp_random_code,</if>
- <if test="machineId != null">machine_id,</if>
- <if test="productionDigit != null">production_digit,</if>
- <if test="currentColorCode != null and currentColorCode != ''">current_color_code,</if>
- <if test="currentSpecification != null">current_specification,</if>
- <if test="currentLotNumber != null">current_lot_number,</if>
- <if test="startTime != null">start_time,</if>
- <if test="plannedEndTime != null">planned_end_time,</if>
- <if test="planStatus != null">plan_status,</if>
- <if test="number != null">`number`,</if>
- <if test="remark != null">remark,</if>
- <if test="createById != null">create_by_id,</if>
- <if test="createBy != null">create_by,</if>
- <if test="updateById != null">update_by_id,</if>
- <if test="updateBy != null">update_by,</if>
- <if test="createTime != null">create_time,</if>
- <if test="updateTime != null">update_time,</if>
- <if test="productId != null">product_id,</if>
- <if test="salesmanId != null">salesman_id,</if>
- <if test="createById!=null and createById!=''">create_by_id,</if>
- <if test="createBy!=null and createBy!=''">create_by,</if>
- <if test="createTime!=null and createTime!=''">create_time,</if>
- <if test="tubeweight!=null and tubeweight!=''">tube_weight,</if>
- <if test="boxweight!=null and boxweight!=''">box_weight,</if>
- <if test="tubecolor!=null and tubecolor!=''">tube_color,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="timestampRandomCode != null">#{timestampRandomCode},</if>
- <if test="machineId != null">#{machineId},</if>
- <if test="productionDigit != null">#{productionDigit},</if>
- <if test="currentColorCode != null and currentColorCode != ''">#{currentColorCode},</if>
- <if test="currentSpecification != null">#{currentSpecification},</if>
- <if test="currentLotNumber != null">#{currentLotNumber},</if>
- <if test="startTime != null">#{startTime},</if>
- <if test="plannedEndTime != null">#{plannedEndTime},</if>
- <if test="planStatus != null">#{planStatus},</if>
- <if test="number != null">#{number},</if>
- <if test="remark != null">#{remark},</if>
- <if test="createById != null">#{createById},</if>
- <if test="createBy != null">#{createBy},</if>
- <if test="updateById != null">#{updatebyId},</if>
- <if test="updateBy != null">#{updateBy},</if>
- <if test="createTime != null">#{createTime},</if>
- <if test="updateTime != null">#{updateTime},</if>
- <if test="productId != null">#{productId},</if>
- <if test="salesmanId != null">#{salesmanId},</if>
- <if test="createById!=null and createById!=''">#{createById},</if>
- <if test="createBy!=null and createBy!=''">#{createBy},</if>
- <if test="createTime!=null and createTime!=''">#{createTime},</if>
- <if test="tubeweight!=null and tubeweight!=''">#{tubeweight},</if>
- <if test="boxweight!=null and boxweight!=''">#{boxweight},</if>
- <if test="tubecolor!=null and tubecolor!=''">#{tubecolor},</if>
- </trim>
- </insert>
- <update id="updateDetailsOfTheRefuelingPlanSpinning" parameterType="com.zkqy.business.domain.DetailsOfTheRefuelingPlanSpinning">
- update {DBNAME}.details_of_the_refueling_plan_spinning
- <trim prefix="SET" suffixOverrides=",">
- <if test="timestampRandomCode != null">timestamp_random_code = #{timestampRandomCode},</if>
- <if test="machineId != null">machine_id = #{machineId},</if>
- <if test="productionDigit != null">production_digit = #{productionDigit},</if>
- <if test="currentColorCode != null and currentColorCode != ''">current_color_code = #{currentColorCode},</if>
- <if test="currentSpecification != null">current_specification = #{currentSpecification},</if>
- <if test="currentLotNumber != null">current_lot_number = #{currentLotNumber},</if>
- <if test="startTime != null">start_time = #{startTime},</if>
- <if test="plannedEndTime != null">planned_end_time = #{plannedEndTime},</if>
- <if test="planStatus != null">plan_status = #{planStatus},</if>
- <if test="number != null">`number` = #{number},</if>
- <if test="remark != null">remark = #{remark},</if>
- <if test="createById != null">create_by_id = #{createById},</if>
- <if test="createBy != null">create_by = #{createBy},</if>
- <if test="updateById != null">update_by_id = #{updateById},</if>
- <if test="updateBy != null">update_by = #{updateBy},</if>
- <if test="createTime != null">create_time = #{createTime},</if>
- <if test="updateTime != null">update_time = #{updateTime},</if>
- <if test="productId != null">product_id = #{productId},</if>
- <if test="salesmanId != null">salesman_id = #{salesmanId},</if>
- <if test="tubeweight !=null and tubeweight !=''">tube_weight= #{tubeweight},</if>
- <if test="boxweight !=null and boxweight !=''">box_weight= #{boxweight},</if>
- <if test="tubecolor !=null and tubecolor !=''">tube_color= #{tubecolor},</if>
- </trim>
- where id = #{id}
- </update>
- <delete id="deleteDetailsOfTheRefuelingPlanSpinningById" parameterType="Long">
- delete from {DBNAME}.details_of_the_refueling_plan_spinning where id = #{id}
- </delete>
- <delete id="deleteDetailsOfTheRefuelingPlanSpinningByIds" parameterType="String">
- delete from {DBNAME}.details_of_the_refueling_plan_spinning where id in
- <foreach item="id" collection="array" open="(" separator="," close=")">
- #{id}
- </foreach>
- </delete>
- <delete id="deleteDetailsOfTheRefuelingPlanSpinningBySalesmanId">
- delete from {DBNAME}.details_of_the_refueling_plan_spinning where salesman_id in
- <foreach item="id" collection="list" open="(" separator="," close=")">
- #{id}
- </foreach>
- </delete>
- <insert id="insertBatchDetailsOfTheRefuelingPlanSpinning" parameterType="java.util.List">
- INSERT INTO {DBNAME}.details_of_the_refueling_plan_spinning
- <trim prefix="(" suffix=")" suffixOverrides=",">
- timestamp_random_code,
- mac_id,
- machine_id,
- current_color_code,
- current_specification,
- current_lot_number,
- production_digit,
- start_time,
- planned_end_time,
- plan_status,
- `number`,
- `product_id`,
- `salesman_id`,
- `productTypeName`,
- `plan_type`,
- create_by,
- create_by_id,
- create_time,
- tube_weight,
- box_weight,
- tube_color,
- </trim>
- VALUES
- <foreach collection="list" item="item" separator=",">
- <trim prefix="(" suffix=")" suffixOverrides=",">
- #{item.timestampRandomCode},
- #{item.macId},
- #{item.machineId},
- #{item.currentColorCode},
- #{item.currentSpecification},
- #{item.currentLotNumber},
- #{item.productionDigit},
- #{item.startTime},
- #{item.plannedEndTime},
- #{item.planStatus},
- #{item.number},
- #{item.productId},
- #{item.salesmanId},
- #{item.productTypeName},
- #{item.planType},
- #{item.createBy},
- #{item.createById},
- #{item.createTime},
- #{item.tubeweight},
- #{item.boxweight},
- #{item.tubecolor},
- </trim>
- </foreach>
- </insert>
- </mapper>
|