| | |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="cn.gistack.sm.patrol.mapper.PatrolGroupItemMapper"> |
| | | |
| | | <select id="selectPatrolGroupItemList" resultType="cn.gistack.sm.patrol.entity.PatrolGroupItem"> |
| | | SELECT id,group_id,items_name,description FROM SM_PATROL_GROUP_ITEM WHERE is_deleted = 0 |
| | | <select id="selectPatrolGroupItemList" resultType="cn.gistack.sm.patrol.vo.PatrolGroupItemVO"> |
| | | SELECT |
| | | spgi.id,spgi.group_id,spgi.items_name,spgi.description, |
| | | spg.name as groupName |
| | | FROM SM_PATROL_GROUP_ITEM spgi |
| | | left join SM_PATROL_GROUP spg on spg.id = spgi.group_id |
| | | WHERE spgi.is_deleted = 0 |
| | | <if test="patrolGroupItem.groupId != null and patrolGroupItem.groupId != '' "> |
| | | and group_id = #{patrolGroupItem.groupId} |
| | | and spgi.group_id = #{patrolGroupItem.groupId} |
| | | </if> |
| | | <if test="patrolGroupItem.itemsName !=null and patrolGroupItem.itemsName !=''"> |
| | | AND items_name LIKE CONCAT('%',#{patrolGroupItem.itemsName},'%') |
| | | AND spgi.items_name LIKE CONCAT('%',#{patrolGroupItem.itemsName},'%') |
| | | </if> |
| | | <if test="patrolGroupItem.description !=null and patrolGroupItem.description !=''"> |
| | | AND name LIKE CONCAT('%',#{patrolGroupItem.description},'%') |
| | | AND spgi.description LIKE CONCAT('%',#{patrolGroupItem.description},'%') |
| | | </if> |
| | | </select> |
| | | </mapper> |