178 lines
11 KiB
XML
178 lines
11 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.bonus.material.ma.mapper.MachineMapper">
|
||
|
|
<resultMap type="com.bonus.material.ma.domain.Machine" id="MachineResult">
|
||
|
|
<result property="maId" column="ma_id" />
|
||
|
|
<result property="typeId" column="type_id" />
|
||
|
|
<result property="maCode" column="ma_code" />
|
||
|
|
<result property="preCode" column="pre_code" />
|
||
|
|
<result property="maStatus" column="ma_status" />
|
||
|
|
<result property="qrCode" column="qr_code" />
|
||
|
|
<result property="buyPrice" column="buy_price" />
|
||
|
|
<result property="maVender" column="ma_vender" />
|
||
|
|
<result property="outFacTime" column="out_fac_time" />
|
||
|
|
<result property="outFacCode" column="out_fac_code" />
|
||
|
|
<result property="assetsCode" column="assets_code" />
|
||
|
|
<result property="checkMan" column="check_man" />
|
||
|
|
<result property="thisCheckTime" column="this_check_time" />
|
||
|
|
<result property="nextCheckTime" column="next_check_time" />
|
||
|
|
<result property="gpsCode" column="gps_code" />
|
||
|
|
<result property="rfidCode" column="rfid_code" />
|
||
|
|
<result property="erpCode" column="erp_code" />
|
||
|
|
<result property="transferCode" column="transfer_code" />
|
||
|
|
<result property="inOutNum" column="in_out_num" />
|
||
|
|
<result property="buyTask" column="buy_task" />
|
||
|
|
<result property="ownHouse" column="own_house" />
|
||
|
|
<result property="companyId" column="company_id" />
|
||
|
|
<result property="createTime" column="create_time" />
|
||
|
|
<result property="updateTime" column="update_time" />
|
||
|
|
<result property="inspectMan" column="inspect_man" />
|
||
|
|
<result property="inspectStatus" column="inspect_status" />
|
||
|
|
<result property="phone" column="phone" />
|
||
|
|
</resultMap>
|
||
|
|
|
||
|
|
<sql id="selectMachineVo">
|
||
|
|
select ma_id, type_id, ma_code, pre_code, ma_status, qr_code, buy_price, ma_vender, out_fac_time, out_fac_code, assets_code, check_man, this_check_time, next_check_time, gps_code, rfid_code, erp_code, transfer_code, in_out_num, buy_task, own_house, company_id, create_time, update_time, inspect_man, inspect_status, phone from ma_machine
|
||
|
|
</sql>
|
||
|
|
|
||
|
|
<select id="selectMachineList" parameterType="com.bonus.material.ma.domain.Machine" resultMap="MachineResult">
|
||
|
|
<include refid="selectMachineVo"/>
|
||
|
|
<where>
|
||
|
|
<if test="typeId != null "> and type_id = #{typeId}</if>
|
||
|
|
<if test="maCode != null and maCode != ''"> and ma_code = #{maCode}</if>
|
||
|
|
<if test="preCode != null and preCode != ''"> and pre_code = #{preCode}</if>
|
||
|
|
<if test="maStatus != null and maStatus != ''"> and ma_status = #{maStatus}</if>
|
||
|
|
<if test="qrCode != null and qrCode != ''"> and qr_code = #{qrCode}</if>
|
||
|
|
<if test="buyPrice != null "> and buy_price = #{buyPrice}</if>
|
||
|
|
<if test="maVender != null and maVender != ''"> and ma_vender = #{maVender}</if>
|
||
|
|
<if test="outFacTime != null "> and out_fac_time = #{outFacTime}</if>
|
||
|
|
<if test="outFacCode != null and outFacCode != ''"> and out_fac_code = #{outFacCode}</if>
|
||
|
|
<if test="assetsCode != null and assetsCode != ''"> and assets_code = #{assetsCode}</if>
|
||
|
|
<if test="checkMan != null and checkMan != ''"> and check_man = #{checkMan}</if>
|
||
|
|
<if test="thisCheckTime != null "> and this_check_time = #{thisCheckTime}</if>
|
||
|
|
<if test="nextCheckTime != null "> and next_check_time = #{nextCheckTime}</if>
|
||
|
|
<if test="gpsCode != null and gpsCode != ''"> and gps_code = #{gpsCode}</if>
|
||
|
|
<if test="rfidCode != null and rfidCode != ''"> and rfid_code = #{rfidCode}</if>
|
||
|
|
<if test="erpCode != null and erpCode != ''"> and erp_code = #{erpCode}</if>
|
||
|
|
<if test="transferCode != null and transferCode != ''"> and transfer_code = #{transferCode}</if>
|
||
|
|
<if test="inOutNum != null "> and in_out_num = #{inOutNum}</if>
|
||
|
|
<if test="buyTask != null and buyTask != ''"> and buy_task = #{buyTask}</if>
|
||
|
|
<if test="ownHouse != null and ownHouse != ''"> and own_house = #{ownHouse}</if>
|
||
|
|
<if test="companyId != null and companyId != ''"> and company_id = #{companyId}</if>
|
||
|
|
<if test="inspectMan != null and inspectMan != ''"> and inspect_man = #{inspectMan}</if>
|
||
|
|
<if test="inspectStatus != null and inspectStatus != ''"> and inspect_status = #{inspectStatus}</if>
|
||
|
|
<if test="phone != null and phone != ''"> and phone = #{phone}</if>
|
||
|
|
</where>
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<select id="selectMachineByMaId" parameterType="Long" resultMap="MachineResult">
|
||
|
|
<include refid="selectMachineVo"/>
|
||
|
|
where ma_id = #{maId}
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<insert id="insertMachine" parameterType="com.bonus.material.ma.domain.Machine" useGeneratedKeys="true" keyProperty="maId">
|
||
|
|
insert into ma_machine
|
||
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||
|
|
<if test="typeId != null">type_id,</if>
|
||
|
|
<if test="maCode != null">ma_code,</if>
|
||
|
|
<if test="preCode != null">pre_code,</if>
|
||
|
|
<if test="maStatus != null">ma_status,</if>
|
||
|
|
<if test="qrCode != null">qr_code,</if>
|
||
|
|
<if test="buyPrice != null">buy_price,</if>
|
||
|
|
<if test="maVender != null">ma_vender,</if>
|
||
|
|
<if test="outFacTime != null">out_fac_time,</if>
|
||
|
|
<if test="outFacCode != null">out_fac_code,</if>
|
||
|
|
<if test="assetsCode != null">assets_code,</if>
|
||
|
|
<if test="checkMan != null">check_man,</if>
|
||
|
|
<if test="thisCheckTime != null">this_check_time,</if>
|
||
|
|
<if test="nextCheckTime != null">next_check_time,</if>
|
||
|
|
<if test="gpsCode != null">gps_code,</if>
|
||
|
|
<if test="rfidCode != null">rfid_code,</if>
|
||
|
|
<if test="erpCode != null">erp_code,</if>
|
||
|
|
<if test="transferCode != null">transfer_code,</if>
|
||
|
|
<if test="inOutNum != null">in_out_num,</if>
|
||
|
|
<if test="buyTask != null">buy_task,</if>
|
||
|
|
<if test="ownHouse != null">own_house,</if>
|
||
|
|
<if test="companyId != null">company_id,</if>
|
||
|
|
<if test="createTime != null">create_time,</if>
|
||
|
|
<if test="updateTime != null">update_time,</if>
|
||
|
|
<if test="inspectMan != null">inspect_man,</if>
|
||
|
|
<if test="inspectStatus != null">inspect_status,</if>
|
||
|
|
<if test="phone != null">phone,</if>
|
||
|
|
</trim>
|
||
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||
|
|
<if test="typeId != null">#{typeId},</if>
|
||
|
|
<if test="maCode != null">#{maCode},</if>
|
||
|
|
<if test="preCode != null">#{preCode},</if>
|
||
|
|
<if test="maStatus != null">#{maStatus},</if>
|
||
|
|
<if test="qrCode != null">#{qrCode},</if>
|
||
|
|
<if test="buyPrice != null">#{buyPrice},</if>
|
||
|
|
<if test="maVender != null">#{maVender},</if>
|
||
|
|
<if test="outFacTime != null">#{outFacTime},</if>
|
||
|
|
<if test="outFacCode != null">#{outFacCode},</if>
|
||
|
|
<if test="assetsCode != null">#{assetsCode},</if>
|
||
|
|
<if test="checkMan != null">#{checkMan},</if>
|
||
|
|
<if test="thisCheckTime != null">#{thisCheckTime},</if>
|
||
|
|
<if test="nextCheckTime != null">#{nextCheckTime},</if>
|
||
|
|
<if test="gpsCode != null">#{gpsCode},</if>
|
||
|
|
<if test="rfidCode != null">#{rfidCode},</if>
|
||
|
|
<if test="erpCode != null">#{erpCode},</if>
|
||
|
|
<if test="transferCode != null">#{transferCode},</if>
|
||
|
|
<if test="inOutNum != null">#{inOutNum},</if>
|
||
|
|
<if test="buyTask != null">#{buyTask},</if>
|
||
|
|
<if test="ownHouse != null">#{ownHouse},</if>
|
||
|
|
<if test="companyId != null">#{companyId},</if>
|
||
|
|
<if test="createTime != null">#{createTime},</if>
|
||
|
|
<if test="updateTime != null">#{updateTime},</if>
|
||
|
|
<if test="inspectMan != null">#{inspectMan},</if>
|
||
|
|
<if test="inspectStatus != null">#{inspectStatus},</if>
|
||
|
|
<if test="phone != null">#{phone},</if>
|
||
|
|
</trim>
|
||
|
|
</insert>
|
||
|
|
|
||
|
|
<update id="updateMachine" parameterType="com.bonus.material.ma.domain.Machine">
|
||
|
|
update ma_machine
|
||
|
|
<trim prefix="SET" suffixOverrides=",">
|
||
|
|
<if test="typeId != null">type_id = #{typeId},</if>
|
||
|
|
<if test="maCode != null">ma_code = #{maCode},</if>
|
||
|
|
<if test="preCode != null">pre_code = #{preCode},</if>
|
||
|
|
<if test="maStatus != null">ma_status = #{maStatus},</if>
|
||
|
|
<if test="qrCode != null">qr_code = #{qrCode},</if>
|
||
|
|
<if test="buyPrice != null">buy_price = #{buyPrice},</if>
|
||
|
|
<if test="maVender != null">ma_vender = #{maVender},</if>
|
||
|
|
<if test="outFacTime != null">out_fac_time = #{outFacTime},</if>
|
||
|
|
<if test="outFacCode != null">out_fac_code = #{outFacCode},</if>
|
||
|
|
<if test="assetsCode != null">assets_code = #{assetsCode},</if>
|
||
|
|
<if test="checkMan != null">check_man = #{checkMan},</if>
|
||
|
|
<if test="thisCheckTime != null">this_check_time = #{thisCheckTime},</if>
|
||
|
|
<if test="nextCheckTime != null">next_check_time = #{nextCheckTime},</if>
|
||
|
|
<if test="gpsCode != null">gps_code = #{gpsCode},</if>
|
||
|
|
<if test="rfidCode != null">rfid_code = #{rfidCode},</if>
|
||
|
|
<if test="erpCode != null">erp_code = #{erpCode},</if>
|
||
|
|
<if test="transferCode != null">transfer_code = #{transferCode},</if>
|
||
|
|
<if test="inOutNum != null">in_out_num = #{inOutNum},</if>
|
||
|
|
<if test="buyTask != null">buy_task = #{buyTask},</if>
|
||
|
|
<if test="ownHouse != null">own_house = #{ownHouse},</if>
|
||
|
|
<if test="companyId != null">company_id = #{companyId},</if>
|
||
|
|
<if test="createTime != null">create_time = #{createTime},</if>
|
||
|
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||
|
|
<if test="inspectMan != null">inspect_man = #{inspectMan},</if>
|
||
|
|
<if test="inspectStatus != null">inspect_status = #{inspectStatus},</if>
|
||
|
|
<if test="phone != null">phone = #{phone},</if>
|
||
|
|
</trim>
|
||
|
|
where ma_id = #{maId}
|
||
|
|
</update>
|
||
|
|
|
||
|
|
<delete id="deleteMachineByMaId" parameterType="Long">
|
||
|
|
delete from ma_machine where ma_id = #{maId}
|
||
|
|
</delete>
|
||
|
|
|
||
|
|
<delete id="deleteMachineByMaIds" parameterType="String">
|
||
|
|
delete from ma_machine where ma_id in
|
||
|
|
<foreach item="maId" collection="array" open="(" separator="," close=")">
|
||
|
|
#{maId}
|
||
|
|
</foreach>
|
||
|
|
</delete>
|
||
|
|
</mapper>
|