2022-02-15 07:38:58 +00:00
|
|
|
<?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.mca.map.mapper.FieldDataMapper">
|
|
|
|
|
|
|
|
|
|
<resultMap id="fieldDataMap" type="fieldDataVO">
|
|
|
|
|
<result column="id" property="id" />
|
|
|
|
|
<result column="userid" property="userid" />
|
|
|
|
|
<result column="save_date" property="save_date" />
|
|
|
|
|
<result column="data_path" property="data_path" />
|
|
|
|
|
<result column="layer_id" property="layer_id" />
|
|
|
|
|
<result column="field_data" property="field_data" />
|
|
|
|
|
<result column="region" property="region" />
|
|
|
|
|
<result column="description" property="description" />
|
|
|
|
|
<result column="status" property="status" />
|
|
|
|
|
<result column="err_note" property="err_note" />
|
|
|
|
|
<collection property="userVO" resultMap="userVO"></collection>
|
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
|
<resultMap id="userVO" type="userVO">
|
|
|
|
|
<result column="userid" property="userid" />
|
|
|
|
|
<result column="name" property="name" />
|
|
|
|
|
<result column="company" property="company" />
|
|
|
|
|
<result column="email" property="email" />
|
|
|
|
|
<result column="phonenum" property="phonenum" />
|
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
|
<select id="selectFieldDataList" parameterType="fieldDataSearchVO" resultMap="fieldDataMap" >
|
|
|
|
|
SELECT
|
|
|
|
|
a.id,
|
|
|
|
|
b.name,
|
|
|
|
|
b.company,
|
|
|
|
|
a.save_date,
|
|
|
|
|
a.region,
|
|
|
|
|
a.status
|
|
|
|
|
FROM
|
|
|
|
|
map_field_data a LEFT JOIN t_user b ON a.userid=b.userid
|
|
|
|
|
WHERE 1=1
|
2022-02-18 05:01:33 +00:00
|
|
|
|
|
|
|
|
<if test='searchKeyword != null and searchKeyword != ""'>
|
|
|
|
|
<choose>
|
|
|
|
|
<when test='searchCondition eq "all"'>
|
|
|
|
|
AND (a.region LIKE CONCAT('%',#{searchKeyword},'%')
|
|
|
|
|
OR b.name LIKE CONCAT('%',#{searchKeyword},'%')
|
|
|
|
|
OR b.company LIKE CONCAT('%',#{searchKeyword},'%'))
|
|
|
|
|
</when>
|
|
|
|
|
<otherwise>
|
|
|
|
|
AND ${searchCondition} LIKE CONCAT('%',#{searchKeyword},'%')
|
|
|
|
|
</otherwise>
|
|
|
|
|
</choose>
|
|
|
|
|
</if>
|
2022-02-28 07:57:03 +00:00
|
|
|
AND( 1=0
|
|
|
|
|
<if test="status0 == 1">
|
|
|
|
|
OR status = 0
|
|
|
|
|
</if>
|
|
|
|
|
<if test="status1 == 1">
|
|
|
|
|
OR status = 1
|
|
|
|
|
</if>
|
|
|
|
|
<if test="status2 == 1">
|
|
|
|
|
OR status = 2
|
|
|
|
|
</if>
|
|
|
|
|
<if test="status3 == 1">
|
|
|
|
|
OR status = 3
|
|
|
|
|
</if>
|
|
|
|
|
<if test="status4 == 1">
|
|
|
|
|
OR status = 4
|
|
|
|
|
</if>
|
|
|
|
|
)
|
2022-02-15 07:38:58 +00:00
|
|
|
ORDER BY id DESC
|
|
|
|
|
LIMIT #{recordCountPerPage} OFFSET #{firstIndex}
|
|
|
|
|
</select>
|
|
|
|
|
|
2022-02-28 07:57:03 +00:00
|
|
|
<select id="selectFieldDataCnt" resultType="int" parameterType="fieldDataSearchVO">
|
2022-02-15 07:38:58 +00:00
|
|
|
SELECT
|
|
|
|
|
COUNT(*)
|
|
|
|
|
FROM
|
|
|
|
|
map_field_data
|
|
|
|
|
WHERE 1 = 1
|
2022-02-28 07:57:03 +00:00
|
|
|
AND( 1=0
|
|
|
|
|
<if test="status0 == 1">
|
|
|
|
|
OR status = 0
|
|
|
|
|
</if>
|
|
|
|
|
<if test="status1 == 1">
|
|
|
|
|
OR status = 1
|
|
|
|
|
</if>
|
|
|
|
|
<if test="status2 == 1">
|
|
|
|
|
OR status = 2
|
|
|
|
|
</if>
|
|
|
|
|
<if test="status3 == 1">
|
|
|
|
|
OR status = 3
|
|
|
|
|
</if>
|
|
|
|
|
<if test="status4 == 1">
|
|
|
|
|
OR status = 4
|
|
|
|
|
</if>
|
|
|
|
|
)
|
2022-02-15 07:38:58 +00:00
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="selectFieldData" parameterType="String" resultType="fieldDataVO">
|
|
|
|
|
SELECT
|
|
|
|
|
id,
|
|
|
|
|
userid,
|
|
|
|
|
save_date,
|
|
|
|
|
data_path,
|
|
|
|
|
layer_id,
|
|
|
|
|
field_data,
|
|
|
|
|
region,
|
|
|
|
|
description,
|
|
|
|
|
status,
|
|
|
|
|
err_note
|
|
|
|
|
FROM
|
|
|
|
|
map_field_data
|
|
|
|
|
WHERE id = #{id}
|
|
|
|
|
</select>
|
|
|
|
|
</mapper>
|