IMRefundHistoryMapper.xml 2.5 KB
<?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.sibu.orderHelper.integral.web.dao.IMWebRefundHistroyDao">
	
	<resultMap type="com.sibu.orderHelper.integral.model.IMRefundHistroyBean" id="refundHistroyResultMap">
    	<id column="id" property="id"/>
        <result column="created_dt" property="createdDt" />
        <result column="content" property="content" />
        <result column="operator_name" property="operatorName" />
    </resultMap>

	<insert id="addRefundHistroy" parameterType="com.sibu.orderHelper.integral.model.IMRefundHistroyBean">
		INSERT INTO im_refund_history (id,created_dt,content,operator_name )
		VALUES ( #{id}, NOW(),#{content},#{operatorName})
	</insert>

	<select id="listRefundHistroy" resultMap="refundHistroyResultMap" parameterType="java.util.Map">
		select * from im_refund_history
		where 1=1
		<if test="keyword != null and keyword !=''">
			and content like concat('%',#{keyword},'%')
		</if>
		<if test="startCreateDt != null and startCreateDt !=''">
			and created_dt >= #{startCreateDt}
		</if>
		<if test="endCreateDt != null and endCreateDt != ''">
			<![CDATA[
		   and created_dt <= #{endCreateDt}
		  ]]>
		</if>
		ORDER BY created_dt DESC
		LIMIT ${pageNow}, ${pageSize}
	</select>


	<select id="totalRefundHistroy"  resultType="java.lang.Integer" parameterType="java.util.Map">
		select COUNT(*) from im_refund_history
		where 1=1
		<if test="keyword != null and keyword !=''">
			and content like concat('%',#{keyword},'%')
		</if>
		<if test="startCreateDt != null and startCreateDt !=''">
			and created_dt >= #{startCreateDt}
		</if>
		<if test="endCreateDt != null and endCreateDt != ''">
			<![CDATA[
		   and created_dt <= #{endCreateDt}
		  ]]>
		</if>
	</select>

	<delete id="deleteRefundHistroy" parameterType="java.lang.String">
        delete from im_refund_history where id=#{id}
	</delete>

	<select id="getRefundHistroyTemplateExcelData" resultMap="refundHistroyResultMap" parameterType="java.util.Map">
		select * from im_refund_history
		where 1=1
		<if test="keyword != null and keyword !=''">
			and content like concat('%',#{keyword},'%')
		</if>
		<if test="startCreateDt != null and startCreateDt !=''">
			and created_dt >= #{startCreateDt}
		</if>
		<if test="endCreateDt != null and endCreateDt != ''">
			<![CDATA[
		   and created_dt <= #{endCreateDt}
		  ]]>
		</if>
		ORDER BY created_dt DESC
	</select>
</mapper>