|  | @@ -2,21 +2,21 @@
 | 
											
												
													
														|  |  <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 |  |  <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 | 
											
												
													
														|  |  <mapper namespace="com.pj.project.tb_costomer.TbCostomerMapper">
 |  |  <mapper namespace="com.pj.project.tb_costomer.TbCostomerMapper">
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | -	<!-- 增 [G] -->
 |  | 
 | 
											
												
													
														|  | -	<insert id="add">
 |  | 
 | 
											
												
													
														|  | 
 |  | +    <!-- 增 [G] -->
 | 
											
												
													
														|  | 
 |  | +    <insert id="add">
 | 
											
												
													
														|  |  		insert into 
 |  |  		insert into 
 | 
											
												
													
														|  |  		tb_costomer (id, name, phone, duty_people, address_ids, address_str, business_licence, status, creare_time, judge_status, judge_time, judge_content) 
 |  |  		tb_costomer (id, name, phone, duty_people, address_ids, address_str, business_licence, status, creare_time, judge_status, judge_time, judge_content) 
 | 
											
												
													
														|  |  		values (#{id}, #{name}, #{phone}, #{dutyPeople}, #{addressIds}, #{addressStr}, #{businessLicence}, #{status}, #{creareTime}, #{judgeStatus}, #{judgeTime}, #{judgeContent}) 
 |  |  		values (#{id}, #{name}, #{phone}, #{dutyPeople}, #{addressIds}, #{addressStr}, #{businessLicence}, #{status}, #{creareTime}, #{judgeStatus}, #{judgeTime}, #{judgeContent}) 
 | 
											
												
													
														|  |  	</insert>
 |  |  	</insert>
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | -	<!-- 删 -->
 |  | 
 | 
											
												
													
														|  | -	<delete id="delete">
 |  | 
 | 
											
												
													
														|  | 
 |  | +    <!-- 删 -->
 | 
											
												
													
														|  | 
 |  | +    <delete id="delete">
 | 
											
												
													
														|  |  		delete from tb_costomer 
 |  |  		delete from tb_costomer 
 | 
											
												
													
														|  |  		where id = #{id}
 |  |  		where id = #{id}
 | 
											
												
													
														|  |  	</delete>
 |  |  	</delete>
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | -	<!-- 改 [G] -->
 |  | 
 | 
											
												
													
														|  | -	<update id="update">
 |  | 
 | 
											
												
													
														|  | 
 |  | +    <!-- 改 [G] -->
 | 
											
												
													
														|  | 
 |  | +    <update id="update">
 | 
											
												
													
														|  |  		update tb_costomer set
 |  |  		update tb_costomer set
 | 
											
												
													
														|  |  		id = #{id}, 
 |  |  		id = #{id}, 
 | 
											
												
													
														|  |  		name = #{name}, 
 |  |  		name = #{name}, 
 | 
											
										
											
												
													
														|  | @@ -34,82 +34,78 @@
 | 
											
												
													
														|  |  	</update>
 |  |  	</update>
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | -	<!-- ================================== 查询相关 ================================== -->
 |  | 
 | 
											
												
													
														|  | 
 |  | +    <!-- ================================== 查询相关 ================================== -->
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | -	
 |  | 
 | 
											
												
													
														|  | -	<!-- 通用映射:手动模式 -->
 |  | 
 | 
											
												
													
														|  | -	<resultMap id="model" type="com.pj.project.tb_costomer.TbCostomer">
 |  | 
 | 
											
												
													
														|  | -		<result property="id" column="id" />
 |  | 
 | 
											
												
													
														|  | -		<result property="name" column="name" />
 |  | 
 | 
											
												
													
														|  | -		<result property="phone" column="phone" />
 |  | 
 | 
											
												
													
														|  | -		<result property="dutyPeople" column="duty_people" />
 |  | 
 | 
											
												
													
														|  | -		<result property="addressIds" column="address_ids" />
 |  | 
 | 
											
												
													
														|  | -		<result property="addressStr" column="address_str" />
 |  | 
 | 
											
												
													
														|  | -		<result property="businessLicence" column="business_licence" />
 |  | 
 | 
											
												
													
														|  | -		<result property="status" column="status" />
 |  | 
 | 
											
												
													
														|  | -		<result property="creareTime" column="creare_time" />
 |  | 
 | 
											
												
													
														|  | -		<result property="judgeStatus" column="judge_status" />
 |  | 
 | 
											
												
													
														|  | -		<result property="judgeTime" column="judge_time" />
 |  | 
 | 
											
												
													
														|  | -		<result property="judgeContent" column="judge_content" />
 |  | 
 | 
											
												
													
														|  | -	</resultMap>
 |  | 
 | 
											
												
													
														|  | -	
 |  | 
 | 
											
												
													
														|  | -	<!-- 公共查询sql片段 -->
 |  | 
 | 
											
												
													
														|  | -	<sql id="select_sql">
 |  | 
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +    <!-- 通用映射:手动模式 -->
 | 
											
												
													
														|  | 
 |  | +    <resultMap id="model" type="com.pj.project.tb_costomer.TbCostomer">
 | 
											
												
													
														|  | 
 |  | +        <result property="id" column="id"/>
 | 
											
												
													
														|  | 
 |  | +        <result property="name" column="name"/>
 | 
											
												
													
														|  | 
 |  | +        <result property="phone" column="phone"/>
 | 
											
												
													
														|  | 
 |  | +        <result property="dutyPeople" column="duty_people"/>
 | 
											
												
													
														|  | 
 |  | +        <result property="addressIds" column="address_ids"/>
 | 
											
												
													
														|  | 
 |  | +        <result property="addressStr" column="address_str"/>
 | 
											
												
													
														|  | 
 |  | +        <result property="businessLicence" column="business_licence"/>
 | 
											
												
													
														|  | 
 |  | +        <result property="status" column="status"/>
 | 
											
												
													
														|  | 
 |  | +        <result property="creareTime" column="creare_time"/>
 | 
											
												
													
														|  | 
 |  | +        <result property="judgeStatus" column="judge_status"/>
 | 
											
												
													
														|  | 
 |  | +        <result property="judgeTime" column="judge_time"/>
 | 
											
												
													
														|  | 
 |  | +        <result property="judgeContent" column="judge_content"/>
 | 
											
												
													
														|  | 
 |  | +    </resultMap>
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +    <!-- 公共查询sql片段 -->
 | 
											
												
													
														|  | 
 |  | +    <sql id="select_sql">
 | 
											
												
													
														|  |  		select 	*
 |  |  		select 	*
 | 
											
												
													
														|  |  		from tb_costomer
 |  |  		from tb_costomer
 | 
											
												
													
														|  |  	</sql>
 |  |  	</sql>
 | 
											
												
													
														|  | -	
 |  | 
 | 
											
												
													
														|  | -	<!-- 查 - 根据id -->
 |  | 
 | 
											
												
													
														|  | -	<select id="getById" resultMap="model">
 |  | 
 | 
											
												
													
														|  | -		<include refid="select_sql"></include>
 |  | 
 | 
											
												
													
														|  | -		where id = #{id}
 |  | 
 | 
											
												
													
														|  | -	</select>
 |  | 
 | 
											
												
													
														|  | -	
 |  | 
 | 
											
												
													
														|  | -	<!-- 查集合 - 根据条件(参数为空时代表忽略指定条件) [G] -->
 |  | 
 | 
											
												
													
														|  | -	<select id="getList" resultMap="model">
 |  | 
 | 
											
												
													
														|  | -		<include refid="select_sql"></include>
 |  | 
 | 
											
												
													
														|  | -		<where>
 |  | 
 | 
											
												
													
														|  | -			<if test=' this.has("id") '> and id = #{id} </if>
 |  | 
 | 
											
												
													
														|  | -			<if test=' this.has("name") '> and name like concat('%',#{name},'%')  </if>
 |  | 
 | 
											
												
													
														|  | -			<if test=' this.has("phone") '> and phone like concat('%',#{phone},'%')  </if>
 |  | 
 | 
											
												
													
														|  | -			<if test=' this.has("dutyPeople") '> and duty_people  like concat('%',#{dutyPeople},'%') </if>
 |  | 
 | 
											
												
													
														|  | -			<if test=' this.has("addressIds") '> and address_ids = #{addressIds} </if>
 |  | 
 | 
											
												
													
														|  | -			<if test=' this.has("addressStr") '> and address_str = #{addressStr} </if>
 |  | 
 | 
											
												
													
														|  | -			<if test=' this.has("status") '> and status = #{status} </if>
 |  | 
 | 
											
												
													
														|  | -			<if test=' this.has("creareTime") '> and creare_time = #{creareTime} </if>
 |  | 
 | 
											
												
													
														|  | -			<if test=' this.has("judgeStatus") '> and judge_status = #{judgeStatus} </if>
 |  | 
 | 
											
												
													
														|  | -			<if test=' this.has("judgeTime") '> and judge_time = #{judgeTime} </if>
 |  | 
 | 
											
												
													
														|  | -			<if test=' this.has("type") '> and type = #{type} </if>
 |  | 
 | 
											
												
													
														|  | -			<if test=' this.has("partner") '> and type != 0 </if>
 |  | 
 | 
											
												
													
														|  | -			<if test=' this.has("judgeContent") '> and judge_content = #{judgeContent} </if>
 |  | 
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +    <!-- 查 - 根据id -->
 | 
											
												
													
														|  | 
 |  | +    <select id="getById" resultMap="model">
 | 
											
												
													
														|  | 
 |  | +        <include refid="select_sql"></include>
 | 
											
												
													
														|  | 
 |  | +        where id = #{id}
 | 
											
												
													
														|  | 
 |  | +    </select>
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +    <!-- 查集合 - 根据条件(参数为空时代表忽略指定条件) [G] -->
 | 
											
												
													
														|  | 
 |  | +    <select id="getList" resultMap="model">
 | 
											
												
													
														|  | 
 |  | +        <include refid="select_sql"></include>
 | 
											
												
													
														|  | 
 |  | +        <where>
 | 
											
												
													
														|  | 
 |  | +            <if test=' this.has("id") '>and id = #{id}</if>
 | 
											
												
													
														|  | 
 |  | +            <if test=' this.has("name") '>and name like concat('%',#{name},'%')</if>
 | 
											
												
													
														|  | 
 |  | +            <if test=' this.has("phone") '>and phone like concat('%',#{phone},'%')</if>
 | 
											
												
													
														|  | 
 |  | +            <if test=' this.has("dutyPeople") '>and duty_people like concat('%',#{dutyPeople},'%')</if>
 | 
											
												
													
														|  | 
 |  | +            <if test=' this.has("addressIds") '>and address_ids = #{addressIds}</if>
 | 
											
												
													
														|  | 
 |  | +            <if test=' this.has("addressStr") '>and address_str = #{addressStr}</if>
 | 
											
												
													
														|  | 
 |  | +            <if test=' this.has("status") '>and status = #{status}</if>
 | 
											
												
													
														|  | 
 |  | +            <if test=' this.has("creareTime") '>and creare_time = #{creareTime}</if>
 | 
											
												
													
														|  | 
 |  | +            <if test=' this.has("judgeStatus") '>and judge_status = #{judgeStatus}</if>
 | 
											
												
													
														|  | 
 |  | +            <if test=' this.has("judgeTime") '>and judge_time = #{judgeTime}</if>
 | 
											
												
													
														|  | 
 |  | +            <if test=' this.has("type") '>and type = #{type}</if>
 | 
											
												
													
														|  | 
 |  | +            <if test=' this.has("partner") '>and type != 0</if>
 | 
											
												
													
														|  | 
 |  | +            <if test=' this.has("judgeContent") '>and judge_content = #{judgeContent}</if>
 | 
											
												
													
														|  |              <if test=' this.has("current") '>
 |  |              <if test=' this.has("current") '>
 | 
											
												
													
														|  |                  <if test=' current != 0 '>and judge_status = #{current}</if>
 |  |                  <if test=' current != 0 '>and judge_status = #{current}</if>
 | 
											
												
													
														|  |              </if>
 |  |              </if>
 | 
											
												
													
														|  | -		</where>
 |  | 
 | 
											
												
													
														|  | -		order by
 |  | 
 | 
											
												
													
														|  | -		<choose>
 |  | 
 | 
											
												
													
														|  | -			<when test='sortType == 1'> id desc </when>
 |  | 
 | 
											
												
													
														|  | -			<when test='sortType == 2'> name desc </when>
 |  | 
 | 
											
												
													
														|  | -			<when test='sortType == 3'> phone desc </when>
 |  | 
 | 
											
												
													
														|  | -			<when test='sortType == 4'> duty_people desc </when>
 |  | 
 | 
											
												
													
														|  | -			<when test='sortType == 5'> address_ids desc </when>
 |  | 
 | 
											
												
													
														|  | -			<when test='sortType == 6'> address_str desc </when>
 |  | 
 | 
											
												
													
														|  | -			<when test='sortType == 7'> status desc </when>
 |  | 
 | 
											
												
													
														|  | -			<when test='sortType == 8'> creare_time desc </when>
 |  | 
 | 
											
												
													
														|  | -			<when test='sortType == 9'> judge_status desc </when>
 |  | 
 | 
											
												
													
														|  | -			<when test='sortType == 10'> judge_time desc </when>
 |  | 
 | 
											
												
													
														|  | -			<when test='sortType == 11'> judge_content desc </when>
 |  | 
 | 
											
												
													
														|  | -			<otherwise> id desc </otherwise>
 |  | 
 | 
											
												
													
														|  | -		</choose>
 |  | 
 | 
											
												
													
														|  | 
 |  | +        </where>
 | 
											
												
													
														|  | 
 |  | +        order by
 | 
											
												
													
														|  | 
 |  | +        <choose>
 | 
											
												
													
														|  | 
 |  | +            <when test='sortType == 1'>id desc</when>
 | 
											
												
													
														|  | 
 |  | +            <when test='sortType == 2'>name desc</when>
 | 
											
												
													
														|  | 
 |  | +            <when test='sortType == 3'>phone desc</when>
 | 
											
												
													
														|  | 
 |  | +            <when test='sortType == 4'>duty_people desc</when>
 | 
											
												
													
														|  | 
 |  | +            <when test='sortType == 5'>address_ids desc</when>
 | 
											
												
													
														|  | 
 |  | +            <when test='sortType == 6'>address_str desc</when>
 | 
											
												
													
														|  | 
 |  | +            <when test='sortType == 7'>status desc</when>
 | 
											
												
													
														|  | 
 |  | +            <when test='sortType == 8'>creare_time desc</when>
 | 
											
												
													
														|  | 
 |  | +            <when test='sortType == 9'>judge_status desc</when>
 | 
											
												
													
														|  | 
 |  | +            <when test='sortType == 10'>judge_time desc</when>
 | 
											
												
													
														|  | 
 |  | +            <when test='sortType == 11'>judge_content desc</when>
 | 
											
												
													
														|  | 
 |  | +            <otherwise>id desc</otherwise>
 | 
											
												
													
														|  | 
 |  | +        </choose>
 | 
											
												
													
														|  | 
 |  | +    </select>
 | 
											
												
													
														|  | 
 |  | +    <select id="findByBusinessTypeOpenid" resultType="java.lang.String">
 | 
											
												
													
														|  | 
 |  | +		SELECT b.openid from tb_costomer a LEFT JOIN sp_admin b on a.id=b.customer_id
 | 
											
												
													
														|  | 
 |  | +        WHERE a.type=#{businessType} and b.openid !='' and b.openid is not null
 | 
											
												
													
														|  |  	</select>
 |  |  	</select>
 | 
											
												
													
														|  | -	
 |  | 
 | 
											
												
													
														|  | -	
 |  | 
 | 
											
												
													
														|  | -	
 |  | 
 | 
											
												
													
														|  | -	
 |  | 
 | 
											
												
													
														|  | -	
 |  | 
 | 
											
												
													
														|  | -	
 |  | 
 | 
											
												
													
														|  | -	
 |  | 
 | 
											
												
													
														|  | -	
 |  | 
 | 
											
												
													
														|  | -	
 |  | 
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |  </mapper>
 |  |  </mapper>
 |