You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
145 lines
6.0 KiB
XML
145 lines
6.0 KiB
XML
<?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.op.wms.mapper.SysFactoryMapper">
|
|
|
|
<resultMap type="SysFactory" id="SysFactoryResult">
|
|
<result property="factoryId" column="factory_id" />
|
|
<result property="parentId" column="parent_id" />
|
|
<result property="ancestors" column="ancestors" />
|
|
<result property="factoryName" column="factory_name" />
|
|
<result property="orderNum" column="order_num" />
|
|
<result property="leader" column="leader" />
|
|
<result property="phone" column="phone" />
|
|
<result property="email" column="email" />
|
|
<result property="status" column="status" />
|
|
<result property="delFlag" column="del_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="factoryCode" column="factory_code" />
|
|
<result property="delFlag" column="del_flag" />
|
|
</resultMap>
|
|
|
|
<sql id="selectSysFactoryVo">
|
|
select factory_id, parent_id, ancestors, factory_name, order_num, leader, phone, email, status, del_flag, create_by, create_time, update_by, update_time, factory_code,del_flag from sys_factory
|
|
</sql>
|
|
|
|
<select id="selectSysFactoryList" parameterType="SysFactory" resultMap="SysFactoryResult">
|
|
<include refid="selectSysFactoryVo"/>
|
|
<where>
|
|
<if test="parentId != null "> and parent_id = #{parentId}</if>
|
|
<if test="ancestors != null and ancestors != ''"> and ancestors = #{ancestors}</if>
|
|
<if test="factoryName != null and factoryName != ''"> and factory_name like concat('%', #{factoryName}, '%')</if>
|
|
<if test="factoryCode != null and factoryCode != ''"> and factory_code like concat('%', #{factoryCode}, '%')</if>
|
|
<if test="orderNum != null "> and order_num = #{orderNum}</if>
|
|
<if test="leader != null and leader != ''"> and leader = #{leader}</if>
|
|
<if test="phone != null and phone != ''"> and phone = #{phone}</if>
|
|
<if test="email != null and email != ''"> and email = #{email}</if>
|
|
<if test="status != null and status != ''"> and status = #{status}</if>
|
|
and del_flag = '0'
|
|
</where>
|
|
</select>
|
|
|
|
<select id="selectSysFactoryByFactoryId" parameterType="Long" resultMap="SysFactoryResult">
|
|
<include refid="selectSysFactoryVo"/>
|
|
where factory_id = #{factoryId}
|
|
and del_flag = '0'
|
|
</select>
|
|
|
|
<insert id="insertSysFactory" parameterType="SysFactory" useGeneratedKeys="true" keyProperty="factoryId">
|
|
insert into sys_factory
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="parentId != null">parent_id,</if>
|
|
<if test="ancestors != null">ancestors,</if>
|
|
<if test="factoryName != null">factory_name,</if>
|
|
<if test="orderNum != null">order_num,</if>
|
|
<if test="leader != null">leader,</if>
|
|
<if test="phone != null">phone,</if>
|
|
<if test="email != null">email,</if>
|
|
<if test="status != null">status,</if>
|
|
<if test="delFlag != null">del_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="factoryCode != null">factory_code,</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="parentId != null">#{parentId},</if>
|
|
<if test="ancestors != null">#{ancestors},</if>
|
|
<if test="factoryName != null">#{factoryName},</if>
|
|
<if test="orderNum != null">#{orderNum},</if>
|
|
<if test="leader != null">#{leader},</if>
|
|
<if test="phone != null">#{phone},</if>
|
|
<if test="email != null">#{email},</if>
|
|
<if test="status != null">#{status},</if>
|
|
<if test="delFlag != null">#{delFlag},</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="factoryCode != null">#{factoryCode},</if>
|
|
</trim>
|
|
</insert>
|
|
|
|
<update id="updateSysFactory" parameterType="SysFactory">
|
|
update sys_factory
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<if test="parentId != null">parent_id = #{parentId},</if>
|
|
<if test="ancestors != null">ancestors = #{ancestors},</if>
|
|
<if test="factoryName != null">factory_name = #{factoryName},</if>
|
|
<if test="orderNum != null">order_num = #{orderNum},</if>
|
|
<if test="leader != null">leader = #{leader},</if>
|
|
<if test="phone != null">phone = #{phone},</if>
|
|
<if test="email != null">email = #{email},</if>
|
|
<if test="status != null">status = #{status},</if>
|
|
<if test="delFlag != null">del_flag = #{delFlag},</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="factoryCode != null">factory_code = #{factoryCode},</if>
|
|
</trim>
|
|
where factory_id = #{factoryId}
|
|
</update>
|
|
|
|
<update id="deleteSysFactoryByFactoryId" parameterType="Long">
|
|
update sys_factory
|
|
set del_flag = '1'
|
|
where factory_id = #{factoryId}
|
|
</update>
|
|
|
|
<update id="deleteSysFactoryByFactoryIds" parameterType="String">
|
|
update sys_factory
|
|
set del_flag = '1'
|
|
where factory_id in
|
|
<foreach item="factoryId" collection="array" open="(" separator="," close=")">
|
|
#{factoryId}
|
|
</foreach>
|
|
</update>
|
|
|
|
<select id="getWorkCenterList" parameterType="SysFactory" resultMap="SysFactoryResult">
|
|
select factory_code,factory_name
|
|
from sys_factory
|
|
where del_flag = '0'
|
|
and f_type = 'c'
|
|
</select>
|
|
|
|
<select id="checkFactoryCodeUnique" parameterType="SysFactory" resultType ="java.lang.String">
|
|
select factory_code
|
|
from sys_factory
|
|
where factory_code = #{factoryCode}
|
|
and del_flag = '0'
|
|
</select>
|
|
|
|
<select id="checkFactoryNameUnique" parameterType="SysFactory" resultType ="java.lang.String">
|
|
select factory_name
|
|
from sys_factory
|
|
where factory_name = #{factoryName}
|
|
and del_flag = '0'
|
|
</select>
|
|
|
|
</mapper> |