|
@@ -2,21 +2,25 @@
|
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
<mapper namespace="com.example.nngkxxdp.dao.CanteenDao">
|
|
|
|
|
|
- <resultMap type="com.example.nngkxxdp.entity.CanteenDO" id="SCanteenMap">
|
|
|
+ <resultMap type="com.example.nngkxxdp.entity.CanteenDO" id="CanteenMap">
|
|
|
<result property="id" column="id" jdbcType="VARCHAR"/>
|
|
|
<result property="canteenName" column="canteen_name" jdbcType="VARCHAR"/>
|
|
|
<result property="canteenPhotoPath" column="canteen_photo_path" jdbcType="VARCHAR"/>
|
|
|
<result property="supplyTimeId" column="supply_time_id" jdbcType="VARCHAR"/>
|
|
|
<result property="founder" column="founder" jdbcType="INTEGER"/>
|
|
|
+ <result property="principal" column="principal" jdbcType="VARCHAR"/>
|
|
|
+ <result property="complaintPhone" column="complaint_phone" jdbcType="VARCHAR"/>
|
|
|
+ <result property="takeoutPhone" column="takeout_phone" jdbcType="VARCHAR"/>
|
|
|
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
|
|
|
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
|
|
|
<result property="isdel" column="isdel" jdbcType="INTEGER"/>
|
|
|
</resultMap>
|
|
|
|
|
|
<!--查询单个-->
|
|
|
- <select id="queryById" resultMap="SCanteenMap">
|
|
|
+ <select id="queryById" resultMap="CanteenMap">
|
|
|
SELECT
|
|
|
- id, canteen_name, canteen_photo_path, supply_time_id, founder, create_time, update_time, isdel
|
|
|
+ id, canteen_name, canteen_photo_path, supply_time_id, founder, principal, complaint_phone, takeout_phone,
|
|
|
+ create_time, update_time, isdel
|
|
|
FROM s_canteen
|
|
|
WHERE id = #{id}
|
|
|
</select>
|
|
@@ -36,7 +40,9 @@
|
|
|
<!--分页列表-->
|
|
|
<select id="pageList" resultType="java.util.Map">
|
|
|
SELECT
|
|
|
- s_canteen.id, canteen_name, canteen_photo_path, supply_time_id, u.user_name founder, s_canteen.create_time, s_canteen.update_time, s_canteen.isdel
|
|
|
+ s_canteen.id, canteen_name, canteen_photo_path, supply_time_id, u.user_name founder, s_canteen.principal,
|
|
|
+ complaint_phone complaintPhone, takeout_phone takeoutPhone, s_canteen.create_time, s_canteen.update_time,
|
|
|
+ s_canteen.isdel
|
|
|
FROM s_canteen
|
|
|
LEFT JOIN p_user u
|
|
|
ON u.id = s_canteen.founder
|
|
@@ -52,8 +58,10 @@
|
|
|
|
|
|
<!--新增所有列-->
|
|
|
<insert id="addSCanteen">
|
|
|
- INSERT INTO s_canteen(id, canteen_name, canteen_photo_path, supply_time_id, founder, create_time, update_time, isdel)
|
|
|
- VALUES (#{id}, #{canteenName}, #{canteenPhotoPath}, #{supplyTimeId}, #{founder}, #{createTime}, #{updateTime}, #{isdel})
|
|
|
+ INSERT INTO s_canteen(id, canteen_name, canteen_photo_path, supply_time_id, founder, principal,
|
|
|
+ complaint_phone, takeout_phone, create_time, update_time, isdel)
|
|
|
+ VALUES (#{id}, #{canteenName}, #{canteenPhotoPath}, #{supplyTimeId}, #{founder}, #{principal}, #{createTime},
|
|
|
+ #{complaintPhone}, #{takeoutPhone}, #{updateTime}, #{isdel})
|
|
|
</insert>
|
|
|
|
|
|
<!--通过主键修改数据-->
|
|
@@ -68,6 +76,15 @@
|
|
|
<if test="founder != null">
|
|
|
founder = #{founder},
|
|
|
</if>
|
|
|
+ <if test="principal != null">
|
|
|
+ principal = #{principal},
|
|
|
+ </if>
|
|
|
+ <if test="complaintPhone != null">
|
|
|
+ complaint_phone = #{complaintPhone},
|
|
|
+ </if>
|
|
|
+ <if test="takeoutPhone != null">
|
|
|
+ takeout_phone = #{takeoutPhone},
|
|
|
+ </if>
|
|
|
<if test="createTime != null">
|
|
|
create_time = #{createTime},
|
|
|
</if>
|