|
@@ -6,6 +6,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
|
<resultMap type="FailureRecordT" id="FailureRecordTResult">
|
|
|
<result property="id" column="id" />
|
|
|
+ <result property="index" column="index" />
|
|
|
<result property="batchName" column="batch_name" />
|
|
|
<result property="quantity" column="quantity" />
|
|
|
<result property="remark" column="remark" />
|
|
@@ -16,7 +17,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</resultMap>
|
|
|
|
|
|
<sql id="selectFailureRecordTVo">
|
|
|
- select id, batch_name, quantity,remark create_by, create_time, update_by, update_time from failure_record_t
|
|
|
+ select id, batch_name, quantity,remark create_by, create_time, update_by, update_time, `index` from failure_record_t
|
|
|
</sql>
|
|
|
|
|
|
<select id="selectFailureRecordTList" parameterType="FailureRecordT" resultMap="FailureRecordTResult">
|
|
@@ -25,12 +26,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="batchName != null and batchName != ''"> and batch_name like concat('%', #{batchName}, '%')</if>
|
|
|
<if test="quantity != null "> and quantity = #{quantity}</if>
|
|
|
</where>
|
|
|
+ order by `index`
|
|
|
</select>
|
|
|
|
|
|
<select id="selectFailureRecordTById" parameterType="Long" resultMap="FailureRecordTResult">
|
|
|
<include refid="selectFailureRecordTVo"/>
|
|
|
where id = #{id}
|
|
|
</select>
|
|
|
+ <select id="findMaxIndexRecord" resultType="java.lang.Integer">
|
|
|
+ select MAX(`index`) from failure_record_t
|
|
|
+ </select>
|
|
|
|
|
|
<insert id="insertFailureRecordT" parameterType="FailureRecordT" useGeneratedKeys="true" keyProperty="id">
|
|
|
insert into failure_record_t
|
|
@@ -42,6 +47,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="createTime != null">create_time,</if>
|
|
|
<if test="updateBy != null">update_by,</if>
|
|
|
<if test="updateTime != null">update_time,</if>
|
|
|
+ <if test="index != null">`index`,</if>
|
|
|
</trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
<if test="batchName != null">#{batchName},</if>
|
|
@@ -51,6 +57,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="createTime != null">#{createTime},</if>
|
|
|
<if test="updateBy != null">#{updateBy},</if>
|
|
|
<if test="updateTime != null">#{updateTime},</if>
|
|
|
+ <if test="index != null">#{index},</if>
|
|
|
</trim>
|
|
|
</insert>
|
|
|
|