chenjiahe
2021-10-14 496b6cdc07dd9d5a78084597510efe9faa781aa7
提交 | 用户 | age
496b6c 1 <?xml version="1.0" encoding="UTF-8" ?>
C 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.medical.dao.mapper.ShopWeekDayMapper">
7
8     <!-- 整个实体类修改,表字段=实体类字段-->
9     <sql id="Update_Column_All">
10         <trim prefixOverrides=",">
11             ,weekDayNum = #{weekDayNum},weekDayName = #{weekDayName},shopId = #{shopId},isDel = #{isDel},createTime = #{createTime}
12         </trim>
13     </sql>
14      
15     <!--  后续通过  namespace.id-->
16     <!--parameterType:输入参数的类型
17     resultType:查询返回结果值的类型  ,返回类型  -->
18     <insert id="insert" parameterType="com.hx.medical.model.ShopWeekDay">
19         <selectKey keyProperty="id" resultType="String" order="BEFORE">
20             select replace(uuid(),'-','') from dual
21         </selectKey>
22         insert into shop_week_day (id,weekDayNum,weekDayName,shopId,isDel,createTime)
23         values (#{id},#{weekDayNum},#{weekDayName},#{shopId},#{isDel},#{createTime})
24     </insert>
25
26     <select id="selectList" resultType="com.hx.medical.model.ShopWeekDay" parameterType="com.hx.mybatisTool.SqlSentence" >
27         ${sqlSentence}
28     </select>
29
30     <select id="selectListMap" resultType="java.util.Map" parameterType="com.hx.mybatisTool.SqlSentence" >
31             ${sqlSentence}
32     </select>
33
34     <select id="selectOne" resultType="com.hx.medical.model.ShopWeekDay" parameterType="com.hx.mybatisTool.SqlSentence" >
35         ${sqlSentence}
36     </select>
37
38     <select id="selectOneMap" resultType="java.util.Map" parameterType="com.hx.mybatisTool.SqlSentence" >
39             ${sqlSentence}
40     </select>
41
42     <select id="selectCount" resultType="int" parameterType="com.hx.mybatisTool.SqlSentence" >
43             select
44                 COUNT(*)
45             from shop_week_day
46                 WHERE ${sqlSentence}
47     </select>
48
49     <select id="selectCountSql" resultType="int" parameterType="com.hx.mybatisTool.SqlSentence" >
50             ${sqlSentence}
51      </select>
52
53     <select id="selectOneByKey" resultType="com.hx.medical.model.ShopWeekDay" parameterType="java.lang.Object" >
54         select 
55             id,weekDayNum,weekDayName,shopId,isDel,createTime
56         from shop_week_day
57         WHERE id = #{value}
58     </select>
59
60     <select id="selectOneByKeyBlob" resultType="com.hx.medical.model.ShopWeekDay" parameterType="java.lang.Object" >
61         select 
62             id,weekDayNum,weekDayName,shopId,isDel,createTime
63         from shop_week_day
64         WHERE id = #{value}
65     </select>
66
67     <update id="updateWhere" parameterType="com.hx.mybatisTool.SqlSentence">
68         update
69             shop_week_day
70         SET ${sqlSentence}
71     </update>
72
73     <update id="updateAll" parameterType="com.hx.medical.model.ShopWeekDay">
74         update shop_week_day
75             SET <include refid="Update_Column_All"/>
76         WHERE id = #{id}
77     </update>
78
79     <delete id="deleteWhere"  parameterType="com.hx.mybatisTool.SqlSentence">
80         delete from shop_week_day WHERE ${sqlSentence}
81     </delete>
82
83     <delete id="deleteById"  parameterType="java.lang.Object">
84         delete from shop_week_day WHERE id = #{value}
85     </delete>
86     
87 </mapper>