123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268 |
- <?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.ams.config.mapper.FlowConfigHeaderMapper">
- <resultMap type="FlowConfigHeader" id="FlowConfigHeaderResult">
- <result property="id" column="id" />
- <result property="flowName" column="flow_name" />
- <result property="flowType" column="flow_type" />
- <result property="skuType" column="sku_type" />
- <result property="skuTypeFlag" column="sku_type_flag" />
- <result property="qty" column="qty" />
- <result property="qtyRange" column="qty_range" />
- <result property="qtyFlag" column="qty_flag" />
- <result property="weight" column="weight" />
- <result property="weightRange" column="weight_range" />
- <result property="weightFlag" column="weight_flag" />
- <result property="supplier" column="supplier" />
- <result property="supplierRange" column="supplier_range" />
- <result property="supplierFlag" column="supplier_flag" />
- <result property="locationFrom" column="location_from" />
- <result property="locationFromFlag" column="location_from_flag" />
- <result property="locationFromDevice" column="location_from_device" />
- <result property="locationFromStrategyFlag" column="location_from_strategy_flag" />
- <result property="locationTo" column="location_to" />
- <result property="locationToFlag" column="location_to_flag" />
- <result property="locationToDevice" column="location_to_device" />
- <result property="locationToStrategyFlag" column="location_to_strategy_flag" />
- <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="remark" column="remark" />
- <result property="relFlow" column="rel_flow" />
- <result property="rootFlow" column="root_flow" />
- </resultMap>
- <resultMap type="FlowConfigHeader" id="FlowConfigHeaderVOResult">
- <result property="id" column="id" />
- <result property="flowName" column="flow_name" />
- <result property="flowType" column="flow_type" />
- <result property="skuType" column="sku_type" />
- <result property="skuTypeFlag" column="sku_type_flag" />
- <result property="qty" column="qty" />
- <result property="qtyRange" column="qty_range" />
- <result property="qtyFlag" column="qty_flag" />
- <result property="weight" column="weight" />
- <result property="weightRange" column="weight_range" />
- <result property="weightFlag" column="weight_flag" />
- <result property="supplier" column="supplier" />
- <result property="supplierRange" column="supplier_range" />
- <result property="supplierFlag" column="supplier_flag" />
- <result property="locationFrom" column="location_from" />
- <result property="locationFromFlag" column="location_from_flag" />
- <result property="locationFromDevice" column="location_from_device" />
- <result property="locationFromStrategyFlag" column="location_from_strategy_flag" />
- <result property="locationTo" column="location_to" />
- <result property="locationToFlag" column="location_to_flag" />
- <result property="locationToDevice" column="location_to_device" />
- <result property="locationToStrategyFlag" column="location_to_strategy_flag" />
- <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="remark" column="remark" />
- <result property="relFlow" column="rel_flow" />
- <result property="rootFlow" column="root_flow" />
- </resultMap>
- <resultMap id="FlowConfigHeaderFlowConfigDetailsResult" type="flowConfigHeaderVO" extends="FlowConfigHeaderVOResult">
- <collection property="flowConfigDetailsList" notNullColumn="sub_id" javaType="java.util.List" resultMap="FlowConfigDetailsResult" />
- </resultMap>
- <resultMap type="flowConfigDetailsVO" id="FlowConfigDetailsResult">
- <result property="id" column="sub_id" />
- <result property="headerId" column="sub_header_id" />
- <result property="lotattId" column="sub_lotatt_id" />
- <result property="lotattName" column="sub_lotatt_name" />
- <result property="lotattFlag" column="sub_lotatt_flag" />
- <result property="createBy" column="sub_create_by" />
- <result property="createTime" column="sub_create_time" />
- <result property="updateBy" column="sub_update_by" />
- <result property="updateTime" column="sub_update_time" />
- <result property="remark" column="sub_remark" />
- <result property="defaultValue" column="sub_default_value" />
- </resultMap>
- <resultMap type="flowConfigLotattVO" id="FlowConfigLotattVOResult">
- <result property="lotattId" column="lotatt_id" />
- <result property="lotattFlag" column="lotatt_flag" />
- <result property="lotattName" column="lotatt_name" />
- <result property="inputType" column="input_type" />
- <result property="inputScope" column="input_scope" />
- <result property="defaultValue" column="lotatt_value" />
- </resultMap>
- <sql id="selectFlowConfigHeaderVo">
- select id, flow_name,flow_type, sku_type, sku_type_flag, qty, qty_flag, weight, weight_flag, supplier, supplier_flag, location_from,location_from_flag, location_from_device, location_to,location_to_flag, location_to_device, create_by, create_time, update_by, update_time, remark,location_from_strategy_flag ,location_to_strategy_flag,rel_flow,root_flow from flow_config_header
- </sql>
- <select id="selectFlowConfigHeaderList" parameterType="FlowConfigHeader" resultMap="FlowConfigHeaderResult">
- <include refid="selectFlowConfigHeaderVo"/>
- <where>
- <if test="flowName != null and flowName != ''"> and flow_name like concat('%', #{flowName}, '%')</if>
- </where>
- order by id
- </select>
- <select id="selectFlowConfigHeaderDict" parameterType="Long" resultMap="FlowConfigHeaderResult">
- <include refid="selectFlowConfigHeaderVo"/>
- where id <> #{headerId}
- </select>
- <select id="selectFlowConfigHeaderBy" parameterType="FlowConfigHeader" resultMap="FlowConfigHeaderResult">
- <include refid="selectFlowConfigHeaderVo"/>
- <where>
- <if test="flowName != null and flowName != ''"> and flow_name = #{flowName}</if>
- </where>
- </select>
- <select id="selectFlowConfigHeaderById" parameterType="Long" resultMap="FlowConfigHeaderFlowConfigDetailsResult">
- select a.id, a.flow_name,a.flow_type, a.sku_type, a.sku_type_flag, a.qty, a.qty_flag, a.weight, a.weight_flag, a.supplier, a.supplier_flag, a.location_from,a.location_from_flag, a.location_from_device, a.location_to,a.location_to_flag, a.location_to_device, a.create_by, a.create_time, a.update_by, a.update_time, a.remark,
- a.qty_range,a.weight_range,a.supplier_range,b.id as sub_id, b.header_id as sub_header_id, b.lotatt_id as sub_lotatt_id,cf.lotatt_name as sub_lotatt_name, b.lotatt_flag as sub_lotatt_flag, b.create_by as sub_create_by, b.create_time as sub_create_time, b.update_by as sub_update_by, b.update_time as sub_update_time, b.remark as sub_remark,b.default_value as sub_default_value,
- a.location_from_strategy_flag,a.location_to_strategy_flag,a.rel_flow,a.root_flow
- from flow_config_header a
- left join flow_config_details b on b.header_id = a.id
- left join lotatt_config cf on b.lotatt_id = cf.lotatt_id
- where a.id = #{id}
- </select>
- <insert id="insertFlowConfigHeader" parameterType="FlowConfigHeader" useGeneratedKeys="true" keyProperty="id">
- insert into flow_config_header
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="flowName != null">flow_name,</if>
- <if test="flowType != null">flow_type,</if>
- <if test="skuType != null">sku_type,</if>
- <if test="skuTypeFlag != null">sku_type_flag,</if>
- <if test="qty != null">qty,</if>
- <if test="qtyRange != null">qty_range,</if>
- <if test="qtyFlag != null">qty_flag,</if>
- <if test="weight != null">weight,</if>
- <if test="weightRange != null">weight_range,</if>
- <if test="weightFlag != null">weight_flag,</if>
- <if test="supplier != null">supplier,</if>
- <if test="supplierRange != null">supplier_range,</if>
- <if test="supplierFlag != null">supplier_flag,</if>
- <if test="locationFrom != null">location_from,</if>
- <if test="locationFromFlag != null">location_from_flag,</if>
- <if test="locationFromDevice != null">location_from_device,</if>
- <if test="locationFromStrategyFlag != null">location_from_strategy_flag,</if>
- <if test="locationTo != null">location_to,</if>
- <if test="locationToFlag != null">location_to_flag,</if>
- <if test="locationToDevice != null">location_to_device,</if>
- <if test="locationToStrategyFlag != null">location_to_strategy_flag,</if>
- <if test="createBy != null">create_by,</if>
- <if test="createTime != null">create_time,</if>
- <if test="updateBy != null">update_by,</if>
- <if test="updateTime != null">update_time,</if>
- <if test="remark != null">remark,</if>
- <if test="relFlow != null">rel_flow,</if>
- <if test="rootFlow != null">root_flow,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="flowName != null">#{flowName},</if>
- <if test="flowType != null">#{flowType},</if>
- <if test="skuType != null">#{skuType},</if>
- <if test="skuTypeFlag != null">#{skuTypeFlag},</if>
- <if test="qty != null">#{qty},</if>
- <if test="qtyRange != null">#{qtyRange},</if>
- <if test="qtyFlag != null">#{qtyFlag},</if>
- <if test="weight != null">#{weight},</if>
- <if test="weightRange != null">#{weightRange},</if>
- <if test="weightFlag != null">#{weightFlag},</if>
- <if test="supplier != null">#{supplier},</if>
- <if test="supplierRange != null">#{supplierRange},</if>
- <if test="supplierFlag != null">#{supplierFlag},</if>
- <if test="locationFrom != null">#{locationFrom},</if>
- <if test="locationFromFlag != null">#{locationFromFlag},</if>
- <if test="locationFromDevice != null">#{locationFromDevice},</if>
- <if test="locationFromStrategyFlag != null">#{locationFromStrategyFlag},</if>
- <if test="locationTo != null">#{locationTo},</if>
- <if test="locationToFlag != null">#{locationToFlag},</if>
- <if test="locationToDevice != null">#{locationToDevice},</if>
- <if test="locationToStrategyFlag != null">#{locationToStrategyFlag},</if>
- <if test="createBy != null">#{createBy},</if>
- <if test="createTime != null">#{createTime},</if>
- <if test="updateBy != null">#{updateBy},</if>
- <if test="updateTime != null">#{updateTime},</if>
- <if test="remark != null">#{remark},</if>
- <if test="relFlow != null">#{relFlow},</if>
- <if test="rootFlow != null">#{rootFlow},</if>
- </trim>
- </insert>
- <update id="updateFlowConfigHeader" parameterType="FlowConfigHeader">
- update flow_config_header
- <trim prefix="SET" suffixOverrides=",">
- <if test="flowName != null">flow_name = #{flowName},</if>
- <if test="flowType != null">flow_type = #{flowType},</if>
- <if test="skuType != null">sku_type = #{skuType},</if>
- <if test="skuTypeFlag != null">sku_type_flag = #{skuTypeFlag},</if>
- <if test="qty != null">qty = #{qty},</if>
- <if test="qtyFlag != null">qty_flag = #{qtyFlag},</if>
- <if test="weight != null">weight = #{weight},</if>
- <if test="weightFlag != null">weight_flag = #{weightFlag},</if>
- <if test="supplier != null">supplier = #{supplier},</if>
- <if test="supplierFlag != null">supplier_flag = #{supplierFlag},</if>
- <if test="locationFrom != null">location_from = #{locationFrom},</if>
- <if test="locationFromFlag != null">location_from_flag = #{locationFromFlag},</if>
- <if test="locationFromDevice != null">location_from_device = #{locationFromDevice},</if>
- <if test="locationFromStrategyFlag != null">location_from_strategy_flag = #{locationFromStrategyFlag},</if>
- <if test="locationTo != null">location_to = #{locationTo},</if>
- <if test="locationToFlag != null">location_to_flag = #{locationToFlag},</if>
- <if test="locationToDevice != null">location_to_device = #{locationToDevice},</if>
- <if test="locationToStrategyFlag != null">location_to_strategy_flag = #{locationToStrategyFlag},</if>
- <if test="createBy != null">create_by = #{createBy},</if>
- <if test="createTime != null">create_time = #{createTime},</if>
- <if test="updateBy != null">update_by = #{updateBy},</if>
- <if test="updateTime != null">update_time = #{updateTime},</if>
- <if test="remark != null">remark = #{remark},</if>
- <if test="relFlow != null">rel_flow = #{relFlow},</if>
- <if test="rootFlow != null">root_flow = #{rootFlow},</if>
- </trim>
- where id = #{id}
- </update>
- <delete id="deleteFlowConfigHeaderById" parameterType="Long">
- delete from flow_config_header where id = #{id}
- </delete>
- <delete id="deleteFlowConfigHeaderByIds" parameterType="String">
- delete from flow_config_header where id in
- <foreach item="id" collection="array" open="(" separator="," close=")">
- #{id}
- </foreach>
- </delete>
- <delete id="deleteFlowConfigDetailsByHeaderIds" parameterType="String">
- delete from flow_config_details where header_id in
- <foreach item="headerId" collection="array" open="(" separator="," close=")">
- #{headerId}
- </foreach>
- </delete>
- <delete id="deleteFlowConfigDetailsByHeaderId" parameterType="Long">
- delete from flow_config_details where header_id = #{headerId}
- </delete>
- <insert id="batchFlowConfigDetails">
- insert into flow_config_details( id, header_id, lotatt_id, lotatt_flag, create_by, create_time, update_by, update_time, remark, default_value) values
- <foreach item="item" index="index" collection="list" separator=",">
- ( #{item.id}, #{item.headerId}, #{item.lotattId}, #{item.lotattFlag}, #{item.createBy}, #{item.createTime}, #{item.updateBy}, #{item.updateTime}, #{item.remark}, #{item.defaultValue})
- </foreach>
- </insert>
- <select id="selectLotattDetails" parameterType="Long" resultMap="FlowConfigLotattVOResult">
- select d.lotatt_id,d.lotatt_flag,l.lotatt_name,l.input_type,l.input_scope,IFNULL(d.default_value,l.default_value) lotatt_value
- from flow_config_details d
- left join lotatt_config l on d.lotatt_id = l.lotatt_id
- where d.header_id = #{id} and d.lotatt_flag <> 'Hidden'
- </select>
- <select id="selectFlowConfigHeaderRel" parameterType="Long" resultMap="FlowConfigHeaderResult">
- <include refid="selectFlowConfigHeaderVo"/>
- where root_flow = #{headerId}
- </select>
- </mapper>
|