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.

138 lines
7.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.device.mapper.EquOutsourceWorkMapper">
<resultMap type="EquOutsourceWork" id="EquOutsourceWorkResult">
<result property="workId" column="work_id" />
<result property="workCode" column="work_code" />
<result property="workPerson" column="work_person" />
<result property="workOutsourcingUnit" column="work_outsourcing_unit" />
<result property="workConnection" column="work_connection" />
<result property="workReason" column="work_reason" />
<result property="workType" column="work_type" />
<result property="managementCode" column="management_code" />
<result property="workCost" column="work_cost" />
<result property="workCostTime" column="work_cost_time" />
<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" />
<result property="factoryCode" column="factory_code" />
</resultMap>
<sql id="selectEquOutsourceWorkVo">
select work_id, work_code, work_person, work_outsourcing_unit, work_connection, work_reason, work_type, management_code, work_cost, work_cost_time, attr1, attr2, attr3, del_flag, create_by, create_time, update_by, update_time, factory_code from equ_outsource_work
</sql>
<select id="selectEquOutsourceWorkList" parameterType="EquOutsourceWork" resultMap="EquOutsourceWorkResult">
<include refid="selectEquOutsourceWorkVo"/>
<where>
<if test="workCode != null and workCode != ''"> and work_code = #{workCode}</if>
<if test="workPerson != null and workPerson != ''"> and work_person = #{workPerson}</if>
<if test="workOutsourcingUnit != null and workOutsourcingUnit != ''"> and work_outsourcing_unit = #{workOutsourcingUnit}</if>
<if test="workConnection != null and workConnection != ''"> and work_connection = #{workConnection}</if>
<if test="workReason != null and workReason != ''"> and work_reason = #{workReason}</if>
<if test="workType != null and workType != ''"> and work_type = #{workType}</if>
<if test="managementCode != null and managementCode != ''"> and management_code = #{managementCode}</if>
<if test="workCost != null and workCost != ''"> and work_cost = #{workCost}</if>
<if test="workCostTime != null and workCostTime != ''"> and work_cost_time = #{workCostTime}</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>
<if test="factoryCode != null and factoryCode != ''"> and factory_code = #{factoryCode}</if>
</where>
</select>
<select id="selectEquOutsourceWorkByWorkId" parameterType="String" resultMap="EquOutsourceWorkResult">
<include refid="selectEquOutsourceWorkVo"/>
where work_id = #{workId}
</select>
<insert id="insertEquOutsourceWork" parameterType="EquOutsourceWork">
insert into equ_outsource_work
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="workId != null">work_id,</if>
<if test="workCode != null">work_code,</if>
<if test="workPerson != null">work_person,</if>
<if test="workOutsourcingUnit != null">work_outsourcing_unit,</if>
<if test="workConnection != null">work_connection,</if>
<if test="workReason != null">work_reason,</if>
<if test="workType != null">work_type,</if>
<if test="managementCode != null">management_code,</if>
<if test="workCost != null">work_cost,</if>
<if test="workCostTime != null">work_cost_time,</if>
<if test="attr1 != null">attr1,</if>
<if test="attr2 != null">attr2,</if>
<if test="attr3 != null">attr3,</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="workId != null">#{workId},</if>
<if test="workCode != null">#{workCode},</if>
<if test="workPerson != null">#{workPerson},</if>
<if test="workOutsourcingUnit != null">#{workOutsourcingUnit},</if>
<if test="workConnection != null">#{workConnection},</if>
<if test="workReason != null">#{workReason},</if>
<if test="workType != null">#{workType},</if>
<if test="managementCode != null">#{managementCode},</if>
<if test="workCost != null">#{workCost},</if>
<if test="workCostTime != null">#{workCostTime},</if>
<if test="attr1 != null">#{attr1},</if>
<if test="attr2 != null">#{attr2},</if>
<if test="attr3 != null">#{attr3},</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="updateEquOutsourceWork" parameterType="EquOutsourceWork">
update equ_outsource_work
<trim prefix="SET" suffixOverrides=",">
<if test="workCode != null">work_code = #{workCode},</if>
<if test="workPerson != null">work_person = #{workPerson},</if>
<if test="workOutsourcingUnit != null">work_outsourcing_unit = #{workOutsourcingUnit},</if>
<if test="workConnection != null">work_connection = #{workConnection},</if>
<if test="workReason != null">work_reason = #{workReason},</if>
<if test="workType != null">work_type = #{workType},</if>
<if test="managementCode != null">management_code = #{managementCode},</if>
<if test="workCost != null">work_cost = #{workCost},</if>
<if test="workCostTime != null">work_cost_time = #{workCostTime},</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">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 work_id = #{workId}
</update>
<delete id="deleteEquOutsourceWorkByWorkId" parameterType="String">
delete from equ_outsource_work where work_id = #{workId}
</delete>
<delete id="deleteEquOutsourceWorkByWorkIds" parameterType="String">
delete from equ_outsource_work where work_id in
<foreach item="workId" collection="array" open="(" separator="," close=")">
#{workId}
</foreach>
</delete>
</mapper>