<!--返回Map--><resultMapid="BaseResultMap"type="com.rongdu.cashloan.rule.domain.RuleInfo"><idcolumn="id"property="id"jdbcType="BIGINT" /><resultcolumn="tb_nid"property="tbNid"jdbcType="VARCHAR" /><resultcolumn="tb_name"property="tbName"jdbcType="VARCHAR" /><resultcolumn="detail"property="detail"jdbcType="VARCHAR" /><resultcolumn="state"property="state"jdbcType="VARCHAR" /><resultcolumn="req_ext"property="reqExt"jdbcType="VARCHAR" /><resultcolumn="add_time"property="addTime"jdbcType="TIMESTAMP" /></resultMap><!--基本的sql查询字段 公共引用...--><sqlid="Base_Column_List">
id,tb_nid,tb_name,detail,state,req_ext,add_time
</sql><!-- 基本的sql查询条件公共引用 --><sqlid="searchBy"><trimprefix="where"prefixOverrides="and|or"><iftest="id !='' and id !=null">
id = #{id,jdbcType=BIGINT}
</if><iftest="tbNid !='' and tbNid !=null">
and tb_nid like CONCAT("%",#{tbNid,jdbcType=VARCHAR},"%")
</if><iftest="tbName !='' and tbName !=null">
and tb_name like CONCAT("%",#{tbName,jdbcType=VARCHAR},"%")
</if><iftest="detail !='' and detail !=null">
and detail = #{detail,jdbcType=VARCHAR}
</if><iftest="state !='' and state !=null">
and state = #{state,jdbcType=VARCHAR}
</if><iftest="reqExt !='' and reqExt !=null">
and req_ext = #{reqExt,jdbcType=VARCHAR}
</if><iftest="addTime !=null">
and add_time = #{addTime,jdbcType=TIMESTAMP}
</if></trim></sql><!--查询语句--><selectid="listSelective"resultMap="BaseResultMap"parameterType="java.util.HashMap">
select
<includerefid="Base_Column_List" />
from arc_rule_info
<includerefid="searchBy"/> order by state asc,add_time desc
</select>
插入语句
<insert id="save" parameterType="com.rongdu.cashloan.rule.domain.RuleInfo">
insert into arc_rule_info(tb_nid,tb_name,detail,state,req_ext,add_time )values(#{tbNid,jdbcType=VARCHAR},#{tbName,jdbcType=VARCHAR},#{detail,jdbcType=VARCHAR},#{state,jdbcType=VARCHAR},#{reqExt,jdbcType=VARCHAR}, #{addTime,jdbcType=TIMESTAMP})
</insert>
修改语句
<update id="update" parameterType="com.rongdu.cashloan.rule.domain.RuleInfo">
update arc_rule_info set
tb_nid = #{tbNid,jdbcType=VARCHAR},
tb_name = #{tbName,jdbcType=VARCHAR},
detail = #{detail,jdbcType=VARCHAR},
state = #{state,jdbcType=VARCHAR},
req_ext = #{reqExt,jdbcType=VARCHAR},
add_time = #{addTime,jdbcType=TIMESTAMP}
where id = #{id ,jdbcType=BIGINT}
</update>
删除语句
<delete id="delInfoById" parameterType="java.util.HashMap">
deletefrom arc_rule_info where id = #{id,jdbcType=BIGINT}
</delete>