ANDRU-PC\Andru
2023-04-14 1f5542c534621417c069dd917a617b32074dc081
提交 | 用户 | age
21488d 1 <?xml version="1.0" encoding="UTF-8" ?>
Z 2 <!DOCTYPE mapper
3 PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
4 "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
5 <!-- namespace:该mapper.xml映射文件的 唯一标识 -->
6 <mapper namespace="com.hx.phip.dao.mapper.RefundRecordMapper">
7
8     <!-- 整个实体类修改,表字段=实体类字段-->
9     <sql id="Update_Column_All">
10         <trim prefixOverrides=",">
7cb59b 11             ,code = #{code},refundOperationType = #{refundOperationType},refundType = #{refundType},refundStatus = #{refundStatus},refundShopId = #{refundShopId},refundShopNo = #{refundShopNo},refundShopName = #{refundShopName},refundTotal = #{refundTotal},refundIntegral = #{refundIntegral},realRefundTotal = #{realRefundTotal},realRefundIntegral = #{realRefundIntegral},payee = #{payee},openBank = #{openBank},openBranch = #{openBranch},account = #{account},refundReason = #{refundReason},remarks = #{remarks},sourceType = #{sourceType},orderId = #{orderId},userId = #{userId},operatorType = #{operatorType},operatorId = #{operatorId},operatorNo = #{operatorNo},operatorName = #{operatorName},operatorAppId = #{operatorAppId},operatorAppCode = #{operatorAppCode},operatorAppName = #{operatorAppName},invalidTime = #{invalidTime},invalidType = #{invalidType},invalidId = #{invalidId},invalidNo = #{invalidNo},invalidName = #{invalidName},invalidRoleNo = #{invalidRoleNo},invalidRoleName = #{invalidRoleName},invalidAppId = #{invalidAppId},invalidAppCode = #{invalidAppCode},invalidAppName = #{invalidAppName},addTime = #{addTime},isDel = #{isDel},createTime = #{createTime},editTime = #{editTime}
21488d 12         </trim>
Z 13     </sql>
14      
15     <!--  后续通过  namespace.id-->
16     <!--parameterType:输入参数的类型
17     resultType:查询返回结果值的类型  ,返回类型  -->
18     <insert id="insert" parameterType="com.hx.phiappt.model.refund.RefundRecord">
19         <selectKey keyProperty="id" resultType="String" order="BEFORE">
20                select replace(uuid(),'-','') from dual
21         </selectKey>
7cb59b 22         insert into refund_record (id,code,refundOperationType,refundType,refundStatus,refundShopId,refundShopNo,refundShopName,refundTotal,refundIntegral,realRefundTotal,realRefundIntegral,payee,openBank,openBranch,account,refundReason,remarks,sourceType,orderId,userId,operatorType,operatorId,operatorNo,operatorName,operatorAppId,operatorAppCode,operatorAppName,invalidTime,invalidType,invalidId,invalidNo,invalidName,invalidRoleNo,invalidRoleName,invalidAppId,invalidAppCode,invalidAppName,addTime,isDel,createTime,editTime)  values (#{id},#{code},#{refundOperationType},#{refundType},#{refundStatus},#{refundShopId},#{refundShopNo},#{refundShopName},#{refundTotal},#{refundIntegral},#{realRefundTotal},#{realRefundIntegral},#{payee},#{openBank},#{openBranch},#{account},#{refundReason},#{remarks},#{sourceType},#{orderId},#{userId},#{operatorType},#{operatorId},#{operatorNo},#{operatorName},#{operatorAppId},#{operatorAppCode},#{operatorAppName},#{invalidTime},#{invalidType},#{invalidId},#{invalidNo},#{invalidName},#{invalidRoleNo},#{invalidRoleName},#{invalidAppId},#{invalidAppCode},#{invalidAppName},#{addTime},#{isDel},#{createTime},#{editTime})
21488d 23     </insert>
2a45d4 24
21488d 25     <select id="selectList" resultType="com.hx.phiappt.model.refund.RefundRecord" parameterType="com.hx.mybatisTool.SqlSentence" >
Z 26         ${sqlSentence}
27     </select>
28
29     <select id="selectListMap" resultType="java.util.Map" parameterType="com.hx.mybatisTool.SqlSentence" >
30             ${sqlSentence}
31     </select>
32
33     <select id="selectOne" resultType="com.hx.phiappt.model.refund.RefundRecord" parameterType="com.hx.mybatisTool.SqlSentence" >
34         ${sqlSentence}
35     </select>
36
37     <select id="selectOneMap" resultType="java.util.Map" parameterType="com.hx.mybatisTool.SqlSentence" >
38             ${sqlSentence}
39     </select>
40
41     <select id="selectCount" resultType="int" parameterType="com.hx.mybatisTool.SqlSentence" >
42             select
43                 COUNT(*)
44             from refund_record
45                 WHERE ${sqlSentence}
46     </select>
47
48     <select id="selectCountSql" resultType="int" parameterType="com.hx.mybatisTool.SqlSentence" >
49             ${sqlSentence}
50      </select>
51
52     <select id="selectOneByKey" resultType="com.hx.phiappt.model.refund.RefundRecord" parameterType="java.lang.Object" >
53         select 
7cb59b 54             id,code,refundOperationType,refundType,refundStatus,refundShopId,refundShopNo,refundShopName,refundTotal,refundIntegral,realRefundTotal,realRefundIntegral,payee,openBank,openBranch,account,refundReason,remarks,sourceType,orderId,userId,operatorType,operatorId,operatorNo,operatorName,operatorAppId,operatorAppCode,operatorAppName,invalidTime,invalidType,invalidId,invalidNo,invalidName,invalidRoleNo,invalidRoleName,invalidAppId,invalidAppCode,invalidAppName,addTime,isDel,createTime,editTime
21488d 55         from refund_record
Z 56         WHERE id = #{value}
57     </select>
58
59     <select id="selectOneByKeyBlob" resultType="com.hx.phiappt.model.refund.RefundRecord" parameterType="java.lang.Object" >
60         select 
7cb59b 61             id,code,refundOperationType,refundType,refundStatus,refundShopId,refundShopNo,refundShopName,refundTotal,refundIntegral,realRefundTotal,realRefundIntegral,payee,openBank,openBranch,account,refundReason,remarks,sourceType,orderId,userId,operatorType,operatorId,operatorNo,operatorName,operatorAppId,operatorAppCode,operatorAppName,invalidTime,invalidType,invalidId,invalidNo,invalidName,invalidRoleNo,invalidRoleName,invalidAppId,invalidAppCode,invalidAppName,addTime,isDel,createTime,editTime
21488d 62         from refund_record
Z 63         WHERE id = #{value}
64     </select>
65
66     <update id="updateWhere" parameterType="com.hx.mybatisTool.SqlSentence">
67         update
68             refund_record
69         SET ${sqlSentence}
70     </update>
71
72     <update id="updateAll" parameterType="com.hx.phiappt.model.refund.RefundRecord">
73         update refund_record
74             SET <include refid="Update_Column_All"/>
75         WHERE id = #{id}
76     </update>
77
78     <delete id="deleteWhere"  parameterType="com.hx.mybatisTool.SqlSentence">
79         delete from refund_record WHERE ${sqlSentence}
80     </delete>
81
82     <delete id="deleteById"  parameterType="java.lang.Object">
83         delete from refund_record WHERE id = #{value}
84     </delete>
1f5542 85
df1cf0 86     <select id="selectOrderId" resultType="com.hx.phiappt.model.refund.RefundRecord">
c7d9b9 87         select refundStatus,id from refund_record where orderId=#{id} and isDel=0 and refundStatus=0
ff383a 88     </select>
21488d 89 </mapper>