<?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.prolog.cs.biz.inbound.dao.rqc.WmsInRqcStRuleMapper">
	<resultMap id="map" type="com.prolog.cs.biz.inbound.dto.rqc.WmsInRqcStRuleDTO">
		<result column="rule_id" property="ruleId"/>
		<result column="rule_name" property="ruleName"/>
		<result column="rqc_st_id" property="rqcStId"/>
		<result column="search_regexp" property="searchRegexp"/>
		<result column="match_regexp" property="matchRegexp"/>
		<result column="sort_index" property="sortIndex"/>
		<result column="regexp_des" property="regexpDes"/>
		<result column="remark" property="remark"/>
		<result column="status" property="status"/>
		<result column="enterprise_id" property="enterpriseId"/>
		<result column="gmt_create" property="gmtCreate"/>
		<result column="creator" property="creator"/>
		<result column="creator_name" property="creatorName"/>
		<result column="gmt_modified" property="gmtModified"/>
		<result column="modifier" property="modifier"/>
		<result column="modifier_name" property="modifierName"/>
		<result column="attribute1" property="attribute1"/>
		<result column="attribute2" property="attribute2"/>
		<result column="attribute3" property="attribute3"/>
	</resultMap>
	<sql id="mainClomuns" >
		t1.rule_id,
		t1.rule_name,
		t1.rqc_st_id,
		t1.search_regexp,
		t1.match_regexp,
		t1.sort_index,
		t1.regexp_des,
		t1.remark,
		t1.status,
		t1.enterprise_id,
		t1.gmt_create,
		t1.creator,
		t1.creator_name,
		t1.gmt_modified,
		t1.modifier,
		t1.modifier_name,
		t1.attribute1,
		t1.attribute2,
		t1.attribute3,
	</sql>
	<select id="getMaxSortRule" resultType="java.lang.Integer">
		SELECT COALESCE(MAX(r.SORT_INDEX),0) FROM wms_in_rqc_st_rule r WHERE r.RQC_ST_ID = #{rqcStId}
	</select>
</mapper>
