You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

95 lines
2.7 KiB

<?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.epmet.dao.screen.ScreenCustomerGridDao">
<delete id="deleteCustomerGrid">
delete from screen_customer_grid
where CUSTOMER_ID = #{customerId}
AND GRID_ID IN
<foreach item="item" collection="gridIds" open="(" separator="," close=")">
#{item}
</foreach>
</delete>
<insert id="batchInsertCustomerGrid" parameterType="map">
insert into screen_customer_grid
(
ID,
CUSTOMER_ID,
GRID_ID,
GRID_NAME,
PARENT_AGENCY_ID,
AREA_MARKS,
CENTER_MARK,
PARTY_MARK,
DEL_FLAG,
REVISION,
CREATED_BY,
CREATED_TIME,
UPDATED_BY,
UPDATED_TIME,
DATA_END_TIME,
ALL_PARENT_IDS
) values
<foreach collection="list" item="item" index="index" separator=",">
(
(SELECT REPLACE(UUID(), '-', '') AS id),
#{customerId},
#{item.gridId},
#{item.gridName},
#{item.parentAgencyId},
#{item.areaMarks},
#{item.centerMark},
#{item.partyMark},
0,
0,
'APP_USER',
now(),
'APP_USER',
now(),
#{item.dataEndTime},
#{item.allParentIds}
)
</foreach>
</insert>
<!-- 查询客户下网格总数 -->
<select id="selectCountByCustomerId" parameterType="map" resultType="java.lang.Integer">
SELECT
count( GRID_ID ) AS total
FROM
screen_customer_grid m
WHERE
m.DEL_FLAG = '0'
AND m.CUSTOMER_ID =#{customerId}
</select>
<!-- 查询客户下网格信息 -->
<select id="selectListByCustomerId" parameterType="map" resultType="com.epmet.dto.ScreenCustomerGridDTO">
SELECT
m.GRID_ID,
m.CUSTOMER_ID,
m.GRID_NAME
FROM
screen_customer_grid m
WHERE
m.DEL_FLAG = '0'
AND m.CUSTOMER_ID = #{customerId}
</select>
<!-- 分页查询网格列表 -->
<select id="pageListByCustomerId" resultType="com.epmet.dto.ScreenCustomerGridDTO" parameterType="com.epmet.dto.indexcal.PageQueryGridFormDTO">
SELECT
m.GRID_ID,
m.CUSTOMER_ID,
m.GRID_NAME
FROM
screen_customer_grid m
WHERE
m.DEL_FLAG = '0'
AND m.CUSTOMER_ID = #{customerId}
order by m.GRID_ID asc
LIMIT #{pageIndex}, #{pageSize}
</select>
</mapper>