| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263 |
- <?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.xunmei.system.mapper.SysNfcBindMapper">
- <resultMap type="com.xunmei.system.domain.SysNfcBind" id="SysNfcBindResult">
- <result property="id" column="id"/>
- <result property="areaId" column="area_id"/>
- <result property="enable" column="enable"/>
- <result property="code" column="code"/>
- <result property="createTime" column="create_time"/>
- <result property="updateId" column="update_id"/>
- <result property="updateBy" column="update_by"/>
- <result property="updateTime" column="update_time"/>
- <result property="orgId" column="org_id"/>
- <result property="orgName" column="org_name"/>
- <result property="orgPath" column="org_path"/>
- <result property="collectionAreaName" column="collection_area_name"/>
- <result property="checkId" column="check_id"/>
- </resultMap>
- <sql id="selectSysNfcBindVo">
- select id,
- area_id,
- enable,
- code,
- create_time,
- update_id,
- update_by,
- update_time,
- org_id,
- org_name,
- org_path,
- collection_area_name,
- check_id
- from sys_nfc_bind
- </sql>
- <select id="selectSysNfcBindList" parameterType="com.xunmei.system.domain.SysNfcBind"
- resultMap="SysNfcBindResult">
- <include refid="selectSysNfcBindVo"/>
- <where>
- <if test="areaId != null ">
- and area_id = #{areaId}
- </if>
- <if test="enable != null ">
- and enable = #{enable}
- </if>
- <if test="code != null and code != ''">
- and code = #{code}
- </if>
- <if test="updateId != null ">
- and update_id = #{updateId}
- </if>
- <if test="orgId != null ">
- and org_id = #{orgId}
- </if>
- <if test="orgName != null and orgName != ''">
- and org_name like concat('%', #{orgName}, '%')
- </if>
- <if test="orgPath != null and orgPath != ''">
- and org_path = #{orgPath}
- </if>
- <if test="collectionAreaName != null and collectionAreaName != ''">
- and collection_area_name like concat('%', #{collectionAreaName}, '%')
- </if>
- <if test="checkId != null ">
- and check_id = #{checkId}
- </if>
- </where>
- </select>
- <select id="selectSysNfcBindById" parameterType="Long"
- resultMap="SysNfcBindResult">
- <include refid="selectSysNfcBindVo"/>
- where id = #{id}
- </select>
- <select id="selectNFCPage" resultType="com.xunmei.system.domain.SysNfcBind">
- SELECT
- a.id,
- a.area_id,
- a.area_name,
- a.enable,
- a.del_flag,
- a.code,
- a.label_name,
- a.update_id,
- a.org_id,
- a.org_name,
- a.org_path,
- a.collection_area_name,
- a.check_id,
- a.create_by,
- a.create_time,
- a.update_by,
- a.update_time
- FROM
- sys_nfc_bind a
- LEFT JOIN sys_org b on a.org_id = b.id
- WHERE
- del_flag = 0
- <choose>
- <when test="info.checkSub">
- AND b.path like concat('%', #{info.orgPath}, '%')
- </when>
- <otherwise>
- AND b.id = #{info.orgId}
- </otherwise>
- </choose>
- <if test="info.areaName != null and info.areaName != ''">
- and a.area_name like concat("%",#{info.areaName},"%")
- </if>
- <if test="info.code != null and info.code != ''">
- and a.code like concat("%",#{info.code},"%")
- </if>
- <if test="info.enable != null and info.enable != ''">
- and a.enable = #{info.enable}
- </if>
- <if test="info.labelName !=null and info.labelName !=''">
- and a.label_name=#{info.labelName}
- </if>
- order by a.org_id,a.area_id,code
- </select>
- <select id="selectSysNfcBindByCode" resultType="com.xunmei.system.domain.SysNfcBind">
- SELECT * FROM sys_nfc_bind WHERE del_flag=0 AND code=#{code}
- </select>
- <insert id="insertSysNfcBind" parameterType="com.xunmei.system.domain.SysNfcBind">
- insert into sys_nfc_bind
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="id != null">id,
- </if>
- <if test="areaId != null">area_id,
- </if>
- <if test="enable != null">enable,
- </if>
- <if test="code != null">code,
- </if>
- <if test="createTime != null">create_time,
- </if>
- <if test="updateId != null">update_id,
- </if>
- <if test="updateBy != null">update_by,
- </if>
- <if test="updateTime != null">update_time,
- </if>
- <if test="orgId != null">org_id,
- </if>
- <if test="orgName != null">org_name,
- </if>
- <if test="orgPath != null">org_path,
- </if>
- <if test="collectionAreaName != null">collection_area_name,
- </if>
- <if test="checkId != null">check_id,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="id != null">#{id},
- </if>
- <if test="areaId != null">#{areaId},
- </if>
- <if test="enable != null">#{enable},
- </if>
- <if test="code != null">#{code},
- </if>
- <if test="createTime != null">#{createTime},
- </if>
- <if test="updateId != null">#{updateId},
- </if>
- <if test="updateBy != null">#{updateBy},
- </if>
- <if test="updateTime != null">#{updateTime},
- </if>
- <if test="orgId != null">#{orgId},
- </if>
- <if test="orgName != null">#{orgName},
- </if>
- <if test="orgPath != null">#{orgPath},
- </if>
- <if test="collectionAreaName != null">#{collectionAreaName},
- </if>
- <if test="checkId != null">#{checkId},
- </if>
- </trim>
- </insert>
- <update id="updateSysNfcBind" parameterType="com.xunmei.system.domain.SysNfcBind">
- update sys_nfc_bind
- <trim prefix="SET" suffixOverrides=",">
- <if test="areaId != null">area_id =
- #{areaId},
- </if>
- <if test="enable != null">enable =
- #{enable},
- </if>
- <if test="code != null">code =
- #{code},
- </if>
- <if test="createTime != null">create_time =
- #{createTime},
- </if>
- <if test="updateId != null">update_id =
- #{updateId},
- </if>
- <if test="updateBy != null">update_by =
- #{updateBy},
- </if>
- <if test="updateTime != null">update_time =
- #{updateTime},
- </if>
- <if test="orgId != null">org_id =
- #{orgId},
- </if>
- <if test="orgName != null">org_name =
- #{orgName},
- </if>
- <if test="orgPath != null">org_path =
- #{orgPath},
- </if>
- <if test="collectionAreaName != null">collection_area_name =
- #{collectionAreaName},
- </if>
- <if test="checkId != null">check_id =
- #{checkId},
- </if>
- <if test="delFlag !=null">
- del_flag= #{delFlag}
- </if>
- </trim>
- where id = #{id}
- </update>
- <update id="updateAreaNameByAreaId">
- UPDATE sys_nfc_bind
- SET area_name = #{areaName}
- WHERE area_id = #{areaId}
- </update>
- <update id="updateAreaCheckNameByCheckId">
- UPDATE sys_nfc_bind
- SET collection_area_name = #{collectionAreaName}
- WHERE check_id = #{checkId}
- </update>
- <delete id="deleteSysNfcBindById" parameterType="Long">
- delete
- from sys_nfc_bind
- where id = #{id}
- </delete>
- <delete id="deleteSysNfcBindByIds" parameterType="String">
- delete from sys_nfc_bind where id in
- <foreach item="id" collection="array" open="(" separator="," close=")">
- #{id}
- </foreach>
- </delete>
- <delete id="deleteSysNfcBindByCode">
- delete
- from sys_nfc_bind
- where code = #{code}
- </delete>
- </mapper>
|