上传文件至 'op-modules/op-quality/src/main/resources/mapper'
parent
cf3f610f4f
commit
7e49161b5b
@ -0,0 +1,132 @@
|
||||
<?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.quality.mapper.BaseFileMapper">
|
||||
|
||||
<resultMap type="BaseFile" id="BaseFileResult">
|
||||
<result property="fileId" column="file_id" />
|
||||
<result property="fileName" column="file_name" />
|
||||
<result property="fileAddress" column="file_address" />
|
||||
<result property="sourceId" column="source_id" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="attr1" column="attr1" />
|
||||
<result property="attr2" column="attr2" />
|
||||
<result property="attr3" column="attr3" />
|
||||
<result property="attr4" column="attr4" />
|
||||
<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="selectBaseFileVo">
|
||||
select file_id, file_name, file_address, source_id, remark, attr1,
|
||||
attr2, attr3, attr4, create_by, create_time, update_by,
|
||||
update_time from base_file
|
||||
</sql>
|
||||
|
||||
<select id="selectBaseFileList" parameterType="BaseFile" resultMap="BaseFileResult">
|
||||
<include refid="selectBaseFileVo"/>
|
||||
<where>
|
||||
<if test="fileName != null and fileName != ''"> and file_name like concat('%', #{fileName}, '%')</if>
|
||||
<if test="fileAddress != null and fileAddress != ''"> and file_address = #{fileAddress}</if>
|
||||
<if test="sourceId != null and sourceId != ''"> and source_id = #{sourceId}</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 = #{attr3}</if>
|
||||
<if test="attr4 != null "> and attr4 = #{attr4}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectBaseFileByFileId" parameterType="String" resultMap="BaseFileResult">
|
||||
<include refid="selectBaseFileVo"/>
|
||||
where file_id = #{fileId}
|
||||
</select>
|
||||
<select id="getBaseFileBatch" resultMap="BaseFileResult">
|
||||
<include refid="selectBaseFileVo"/>
|
||||
where source_id = #{sourceId}
|
||||
</select>
|
||||
|
||||
<insert id="insertBaseFile" parameterType="BaseFile">
|
||||
insert into base_file
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="fileId != null">file_id,</if>
|
||||
<if test="fileName != null">file_name,</if>
|
||||
<if test="fileAddress != null">file_address,</if>
|
||||
<if test="sourceId != null">source_id,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="attr1 != null">attr1,</if>
|
||||
<if test="attr2 != null">attr2,</if>
|
||||
<if test="attr3 != null">attr3,</if>
|
||||
<if test="attr4 != null">attr4,</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>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="fileId != null">#{fileId},</if>
|
||||
<if test="fileName != null">#{fileName},</if>
|
||||
<if test="fileAddress != null">#{fileAddress},</if>
|
||||
<if test="sourceId != null">#{sourceId},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="attr1 != null">#{attr1},</if>
|
||||
<if test="attr2 != null">#{attr2},</if>
|
||||
<if test="attr3 != null">#{attr3},</if>
|
||||
<if test="attr4 != null">#{attr4},</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>
|
||||
</trim>
|
||||
</insert>
|
||||
<insert id="insertBaseFileBatch">
|
||||
INSERT INTO base_file(file_id, file_name, file_address, source_id, remark, create_by, create_time)
|
||||
VALUES
|
||||
<foreach collection="baseFiles" index="" item="baseFile" separator=",">
|
||||
(
|
||||
#{baseFile.fileId},
|
||||
#{baseFile.fileName},
|
||||
#{baseFile.fileAddress},
|
||||
#{baseFile.sourceId},
|
||||
#{baseFile.remark},
|
||||
#{baseFile.createBy},
|
||||
#{baseFile.createTime}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<update id="updateBaseFile" parameterType="BaseFile">
|
||||
update base_file
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="fileName != null">file_name = #{fileName},</if>
|
||||
<if test="fileAddress != null">file_address = #{fileAddress},</if>
|
||||
<if test="sourceId != null">source_id = #{sourceId},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="attr1 != null">attr1 = #{attr1},</if>
|
||||
<if test="attr2 != null">attr2 = #{attr2},</if>
|
||||
<if test="attr3 != null">attr3 = #{attr3},</if>
|
||||
<if test="attr4 != null">attr4 = #{attr4},</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>
|
||||
</trim>
|
||||
where file_id = #{fileId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteBaseFileByFileId" parameterType="String">
|
||||
delete from base_file where file_id = #{fileId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteBaseFileByFileIds" parameterType="String">
|
||||
delete from base_file where file_id in
|
||||
<foreach item="fileId" collection="array" open="(" separator="," close=")">
|
||||
#{fileId}
|
||||
</foreach>
|
||||
</delete>
|
||||
<delete id="deleteBaseFileBySourceId">
|
||||
delete from base_file where source_id = #{sourceId}
|
||||
</delete>
|
||||
</mapper>
|
@ -0,0 +1,147 @@
|
||||
<?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.quality.mapper.QcProCheckMapper">
|
||||
|
||||
<resultMap type="QcProCheck" id="QcProCheckResult">
|
||||
<result property="id" column="id"/>
|
||||
<result property="rfid" column="rfid"/>
|
||||
<result property="factoryId" column="factory_id"/>
|
||||
<result property="factoryCode" column="factory_code"/>
|
||||
<result property="workorderId" column="workorder_id" />
|
||||
<result property="workorderCode" column="workorder_code" />
|
||||
<result property="workorderName" column="workorder_name" />
|
||||
<result property="orderId" column="order_id" />
|
||||
<result property="orderCode" column="order_code" />
|
||||
<result property="machineId" column="machine_id" />
|
||||
<result property="machineCode" column="machine_code" />
|
||||
<result property="badMeg" column="bad_meg" />
|
||||
<result property="productId" column="product_id" />
|
||||
<result property="productCode" column="product_code" />
|
||||
<result property="isqua" column="isqua" />
|
||||
<result property="fileId" column="file_id" />
|
||||
<result property="attr1" column="attr1" />
|
||||
<result property="attr2" column="attr2" />
|
||||
<result property="attr3" column="attr3" />
|
||||
<result property="attr4" column="attr4" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
|
||||
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectQuaVo">
|
||||
select id,rfid,factory_id,factory_code,order_id,machine_id,bad_meg,product_id,isqua,isqua,file_id,attr1,attr2,
|
||||
attr3,attr4,create_by,create_time,update_by,update_time,order_code,machine_code,
|
||||
workorder_id,workorder_code,workorder_name,product_code
|
||||
from qc_pro_check
|
||||
</sql>
|
||||
|
||||
<select id="selectQcProCheckList" parameterType="QcProCheck" resultMap="QcProCheckResult">
|
||||
<include refid="selectQuaVo"/>
|
||||
<where>
|
||||
<if test="rfid != null and rfid != ''"> and id = #{id}</if>
|
||||
</where>
|
||||
order by create_time desc
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
<insert id="insertQcProCheck" parameterType="QcProCheck" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into qc_pro_check
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="rfid != null and routeId != ''">route_id,</if>
|
||||
<if test="id != null and id != ''">id,</if>
|
||||
<if test="factoryId != null and factoryId != ''">factory_id,</if>
|
||||
<if test="factoryCode != null and factoryCode != ''">factory_code,</if>
|
||||
<if test="workorderId != null and workorderId != ''">workorder_id,</if>
|
||||
<if test="workorderCode != null and workorderCode != ''">workorder_code,</if>
|
||||
<if test="workorderName != null and workorderName != ''">workorder_name,</if>
|
||||
<if test="orderId != null and orderId != ''">order_id,</if>
|
||||
<if test="orderCode != null and orderCode != ''">order_code,</if>
|
||||
<if test="machineId != null">machine_id,</if>
|
||||
<if test="machineCode != null">machine_code,</if>
|
||||
<if test="badMeg != null and badMeg != ''">bad_meg,</if>
|
||||
<if test="productId != null">product_id,</if>
|
||||
<if test="productCode != null">product_code,</if>
|
||||
<if test="attr1 != null">attr1,</if>
|
||||
<if test="attr2 != null">attr2,</if>
|
||||
<if test="attr3 != null">attr3,</if>
|
||||
<if test="attr4 != null">attr4,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="fileId != null">file_id,</if>
|
||||
<if test="isqua != null">isqua,</if>
|
||||
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null and id != ''">#{id},</if>
|
||||
<if test="rfid != null and rfid != ''">#{rfid},</if>
|
||||
<if test="factoryId != null and factoryId != ''">#{factoryId},</if>
|
||||
<if test="factoryCode != null and factoryCode != ''">#{factoryCode},</if>
|
||||
<if test="workorderId != null and workorderId != ''">#{workorderId},</if>
|
||||
<if test="workorderCode != null and workorderCode != ''">#{workorderCode},</if>
|
||||
<if test="workorderName != null and workorderName != ''">#{workorderName},</if>
|
||||
<if test="orderId != null and orderId != ''">#{orderId},</if>
|
||||
<if test="orderCode != null and orderCode != ''">#{orderCode},</if>
|
||||
<if test="machineId != null">#{machineId},</if>
|
||||
<if test="machineCode != null">#{machineCode},</if>
|
||||
<if test="badMeg != null and badMeg != ''">#{badMeg},</if>
|
||||
<if test="productId != null">#{productId},</if>
|
||||
<if test="productCode != null">#{productCode},</if>
|
||||
<if test="attr1 != null">#{attr1},</if>
|
||||
<if test="attr2 != null">#{attr2},</if>
|
||||
<if test="attr3 != null">#{attr3},</if>
|
||||
<if test="attr4 != null">#{attr4},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="isqua != null">#{isqua},</if>
|
||||
<if test="fileId != null">#{fileId},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
|
||||
<update id="updateQcProCheckById" parameterType="QcProCheck">
|
||||
update qc_pro_check
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="id != null and id != ''">#{id},</if>
|
||||
<if test="rfid != null and rfid != ''">#{rfid},</if>
|
||||
<if test="factoryId != null and factoryId != ''">#{factoryId},</if>
|
||||
<if test="factoryCode != null and factoryCode != ''">#{factoryCode},</if>
|
||||
<if test="workorderId != null and workorderId != ''">#{workorderId},</if>
|
||||
<if test="workorderCode != null and workorderCode != ''">#{workorderCode},</if>
|
||||
<if test="workorderName != null and workorderName != ''">#{workorderName},</if>
|
||||
<if test="orderId != null and orderId != ''">#{orderId},</if>
|
||||
<if test="orderCode != null and orderCode != ''">#{orderCode},</if>
|
||||
<if test="machineId != null">#{machineId},</if>
|
||||
<if test="machineCode != null">#{machineCode},</if>
|
||||
<if test="badMeg != null and badMeg != ''">#{badMeg},</if>
|
||||
<if test="productId != null">#{productId},</if>
|
||||
<if test="productCode != null">#{productCode},</if>
|
||||
<if test="attr1 != null">#{attr1},</if>
|
||||
<if test="attr2 != null">#{attr2},</if>
|
||||
<if test="attr3 != null">#{attr3},</if>
|
||||
<if test="attr4 != null">#{attr4},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="isqua != null">#{isqua},</if>
|
||||
<if test="fileId != null">#{fileId},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteQcProCheckById" parameterType="String">
|
||||
delete from qc_pro_check where id = #{id}
|
||||
</delete>
|
||||
|
||||
|
||||
</mapper>
|
Loading…
Reference in New Issue