<?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.whyc.mapper.DefectiveProductsMapper">
|
<resultMap id="defectiveList" type="defectiveProducts">
|
<id property="id" column="id"></id>
|
<result property="startTime" column="start_time"></result>
|
<result property="provideName" column="provide_name"></result>
|
<result property="productName" column="product_name"></result>
|
<result property="content" column="content"></result>
|
<result property="fileUrl" column="file_url"></result>
|
<result property="type" column="type"></result>
|
<result property="senderId" column="sender_id"></result>
|
<result property="receiverIds" column="receiver_ids"></result>
|
<result property="receiverNames" column="receiver_names"></result>
|
<result property="confirmStatus" column="confirm_status"></result>
|
<result property="sumProduct" column="sum_product"></result>
|
<result property="badProduct" column="bad_product"></result>
|
<result property="note" column="note"></result>
|
<collection property="hisList" javaType="java.util.ArrayList" ofType="com.whyc.pojo.DefectiveProductsHistory" column="{deftId=id}" select="selectDefectiveHis">
|
</collection>
|
</resultMap>
|
<select id="getDefectiveLimit" resultMap="defectiveList">
|
select * from tb_defective_products
|
<where>
|
<if test="dto.startTime!=null">
|
and start_time>=#{dto.startTime}
|
</if>
|
|
<if test="dto.endTime!=null">
|
and start_time<=#{dto.endTime}
|
</if>
|
|
<if test="dto.senderId!=null">
|
and sender_id=#{dto.senderId}
|
</if>
|
|
<if test="dto.confirmStatus!=null">
|
and confirm_status=#{dto.confirmStatus}
|
</if>
|
</where>
|
order by start_time desc
|
</select>
|
|
<select id="selectDefectiveHis">
|
select * from tb_defective_products_history
|
where deft_id=#{deftId}
|
order by record_time desc
|
</select>
|
</mapper>
|