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.
131 lines
6.3 KiB
XML
131 lines
6.3 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.device.mapper.EquOrderPersonMapper">
|
|
|
|
<resultMap type="EquOrderPerson" id="EquOrderPersonResult">
|
|
<result property="id" column="id" />
|
|
<result property="orderCode" column="order_code" />
|
|
<result property="userId" column="user_id" />
|
|
<result property="userName" column="user_name" />
|
|
<result property="factoryCode" column="factory_code" />
|
|
<result property="attr1" column="attr1" />
|
|
<result property="attr2" column="attr2" />
|
|
<result property="attr3" column="attr3" />
|
|
<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" />
|
|
</resultMap>
|
|
|
|
<sql id="selectEquOrderPersonVo">
|
|
select id, order_code, user_id, user_name, factory_code, attr1, attr2, attr3,
|
|
del_flag, create_by, create_time, update_by, update_time
|
|
from equ_order_person
|
|
</sql>
|
|
|
|
<select id="selectEquOrderPersonList" parameterType="EquOrderPerson" resultMap="EquOrderPersonResult">
|
|
<include refid="selectEquOrderPersonVo"/>
|
|
<where>
|
|
<if test="orderCode != null and orderCode != ''"> and order_code = #{orderCode}</if>
|
|
<if test="userId != null "> and user_id = #{userId}</if>
|
|
<if test="userName != null and userName != ''"> and user_name like concat('%', #{userName}, '%')</if>
|
|
<if test="factoryCode != null and factoryCode != ''"> and factory_code = #{factoryCode}</if>
|
|
<if test="attr1 != null and attr1 != ''"> and attr1 = #{attr1}</if>
|
|
<if test="attr2 != null and attr2 != ''"> and attr2 = #{attr2}</if>
|
|
<if test="attr3 != null and attr3 != ''"> and attr3 = #{attr3}</if>
|
|
and del_flag = '0'
|
|
</where>
|
|
</select>
|
|
|
|
<select id="selectEquOrderPersonById" parameterType="String" resultMap="EquOrderPersonResult">
|
|
<include refid="selectEquOrderPersonVo"/>
|
|
where id = #{id} and del_flag = '0'
|
|
</select>
|
|
|
|
<select id="selectEquOrderPersonByOrderCode" resultType="java.lang.String">
|
|
SELECT user_id FROM equ_order_person where order_code = #{orderCode} and del_flag = '0'
|
|
</select>
|
|
|
|
<insert id="insertEquOrderPerson" parameterType="EquOrderPerson">
|
|
insert into equ_order_person
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="id != null">id,</if>
|
|
<if test="orderCode != null">order_code,</if>
|
|
<if test="userId != null">user_id,</if>
|
|
<if test="userName != null">user_name,</if>
|
|
<if test="factoryCode != null and factoryCode != ''">factory_code,</if>
|
|
<if test="attr1 != null">attr1,</if>
|
|
<if test="attr2 != null">attr2,</if>
|
|
<if test="attr3 != null">attr3,</if>
|
|
<if test="delFlag != null and delFlag != ''">del_flag,</if>
|
|
<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>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="id != null">#{id},</if>
|
|
<if test="orderCode != null">#{orderCode},</if>
|
|
<if test="userId != null">#{userId},</if>
|
|
<if test="userName != null">#{userName},</if>
|
|
<if test="factoryCode != null and factoryCode != ''">#{factoryCode},</if>
|
|
<if test="attr1 != null">#{attr1},</if>
|
|
<if test="attr2 != null">#{attr2},</if>
|
|
<if test="attr3 != null">#{attr3},</if>
|
|
<if test="delFlag != null and delFlag != ''">#{delFlag},</if>
|
|
<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>
|
|
</trim>
|
|
</insert>
|
|
<insert id="insertEquOrderPlans">
|
|
insert into equ_order_person
|
|
(
|
|
id, order_code, user_id, user_name, factory_code,
|
|
del_flag, create_by, create_time
|
|
)
|
|
VALUES
|
|
<foreach collection="list" index="index" item="item" separator=",">
|
|
(
|
|
#{item.id},#{item.planCode},
|
|
#{item.userId},#{item.userName},#{item.factroyCode},
|
|
#{item.delFlag},#{item.createBy},#{item.createTime}
|
|
)
|
|
</foreach>
|
|
</insert>
|
|
|
|
<update id="updateEquOrderPerson" parameterType="EquOrderPerson">
|
|
update equ_order_person
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<if test="orderCode != null">order_code = #{orderCode},</if>
|
|
<if test="userId != null">user_id = #{userId},</if>
|
|
<if test="userName != null">user_name = #{userName},</if>
|
|
<if test="factoryCode != null and factoryCode != ''">factory_code = #{factoryCode},</if>
|
|
<if test="attr1 != null">attr1 = #{attr1},</if>
|
|
<if test="attr2 != null">attr2 = #{attr2},</if>
|
|
<if test="attr3 != null">attr3 = #{attr3},</if>
|
|
<if test="delFlag != null and delFlag != ''">del_flag = #{delFlag},</if>
|
|
<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>
|
|
</trim>
|
|
where id = #{id} and del_flag = '0'
|
|
</update>
|
|
|
|
<delete id="deleteEquOrderPersonById" parameterType="String">
|
|
delete from equ_order_person where id = #{id}
|
|
</delete>
|
|
|
|
<delete id="deleteEquOrderPersonByIds" parameterType="String">
|
|
delete from equ_order_person where id in
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
#{id}
|
|
</foreach>
|
|
</delete>
|
|
</mapper>
|