EpPoinenshrineMapper.xml 3.02 KB
Newer Older
葛齐林's avatar
葛齐林 committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
<?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.devplatform.equipment.modules.eppointenshrine.dao.EpPointEnshrineDao">
  <!-- Result Map -->
  <resultMap id="BaseResultMap" type="com.devplatform.equipment.modules.eppointenshrine.bean.EpPointEnshrine">
    <result column="id" property="id"/>
    <result column="point_id" property="pointId"/>
    <result column="deleted" property="deleted"/>
    <result column="create_user_id" property="createUserId"/>
    <result column="create_time" property="createTime"/>
    <result column="byx1" property="byx1"/>
    <result column="byx2" property="byx2"/>
    <result column="byx3" property="byx3"/>
    <result column="sys_sign" property="sysSign"/>
    <result column="station_id" property="stationId"/>
  </resultMap>

  <!-- ep_point_enshrine table all fields -->
  <sql id="Base_Column_List">
		id,point_id,deleted,create_user_id,create_time,byx1,byx2,byx3,sys_sign,station_id
	</sql>

  <!-- 公共查询条件 -->
  <sql id="Example_Where_Clause">
    where deleted=0
    <if test="id!=null and id!=''">and id = #{id}</if>
    <if test="pointId!=null and pointId!=''">and point_id = #{pointId}</if>
    <if test="deleted!=null ">and deleted = #{deleted}</if>
    <if test="createUserId!=null and createUserId!=''">and create_user_id = #{createUserId}</if>
    <if test="createTime!=null ">and create_time = #{createTime}</if>
    <if test="byx1!=null and byx1!=''">and byx1 = #{byx1}</if>
    <if test="byx2!=null and byx2!=''">and byx2 = #{byx2}</if>
    <if test="byx3!=null and byx3!=''">and byx3 = #{byx3}</if>
    <if test="sysSign!=null and sysSign!=''">and sys_sign = #{sysSign}</if>
    <if test="stationId!=null and stationId!=''">and station_id = #{stationId}</if>
  </sql>
  <update id="deleteByPointId" parameterType="com.devplatform.equipment.modules.eppointenshrine.bean.EpPointEnshrine">
    UPDATE ep_point_enshrine
    SET deleted =1
    WHERE point_id = #{pointId} AND create_user_id = #{createUserId} AND deleted =0
    <if test="stationId!=null and stationId!=''">and station_id = #{stationId}</if>
  </update>
  <select id="getByPointId"
    parameterType="com.devplatform.equipment.modules.eppointenshrine.bean.EpPointEnshrine"
    resultType="com.devplatform.equipment.modules.eppointenshrine.bean.EpPointEnshrine">
    SELECT
    <include refid="Base_Column_List"></include>
    FROM ep_point_enshrine WHERE create_user_id = #{createUserId} AND point_id =#{pointId}
    <if test="stationId!=null and stationId!=''">and station_id = #{stationId}</if>
  </select>
  <select id="getByCreateUserId"
    resultType="com.devplatform.equipment.modules.eppointenshrine.bean.EpPointEnshrine">
    SELECT
    <include refid="Base_Column_List"></include>
    FROM ep_point_enshrine WHERE create_user_id = #{createUserId} AND deleted = 0
    <if test="stationId!=null and stationId!=''">and station_id = #{stationId}</if>
  </select>


</mapper>