update:增加高级查询
This commit is contained in:
+41
-13
@@ -2,18 +2,38 @@
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.adc.da.slrs.sarLawsAttrDetailedList.dao.SarLawsAttrDetailedListDao">
|
||||
|
||||
<select id="selectLawsById" resultType="com.adc.da.slrs.sarLawsAttrDetailedList.entity.LawsDto">
|
||||
<select id="selectLawsById" parameterType="com.adc.da.slrs.sarLawsAttrDetailedList.entity.SarFindDto" resultType="com.adc.da.slrs.sarLawsAttrDetailedList.entity.LawsDto">
|
||||
SELECT a.ID,a.STAND_NUMBER,a.STAND_NAME,a.STAND_EN_NAME,b.NYLX,a.PUT_TIME,b.XCXSSRQGJ,b.ZCCSSRQGJ,b.ZRBM,b.SYCPX,b.CYCVPPSBM,b.CYCVPPSCN,b.KCCVPPSBM,b.KCCVPPSCN,b.CLLX as typeApplicable
|
||||
FROM sar_standards_info a LEFT JOIN sar_stand_attr_info b on
|
||||
a.ID = b.STAND_ID
|
||||
<where>
|
||||
<if test="standName != null">
|
||||
(a.STAND_NUMBER LIKE concat ('%',#{standName,jdbcType=VARCHAR},'%')
|
||||
or a.STAND_NAME LIKE concat ('%',#{standName,jdbcType=VARCHAR},'%'))
|
||||
<if test="sarFindDto.standName != null">
|
||||
(a.STAND_NUMBER LIKE concat ('%',#{sarFindDto.standName,jdbcType=VARCHAR},'%')
|
||||
or a.STAND_NAME LIKE concat ('%',#{sarFindDto.standName,jdbcType=VARCHAR},'%'))
|
||||
and
|
||||
</if>
|
||||
<if test="sarFindDto.standEnName != null">
|
||||
a.STAND_EN_NAME LIKE concat ('%',#{sarFindDto.standEnName,jdbcType=VARCHAR},'%')
|
||||
and
|
||||
</if>
|
||||
<if test="sarFindDto.typeApplicable != null">
|
||||
b.CLLX LIKE concat ('%',#{sarFindDto.typeApplicable,jdbcType=VARCHAR},'%')
|
||||
and
|
||||
</if>
|
||||
<if test="sarFindDto.NYLX != null">
|
||||
b.NYLX LIKE concat ('%',#{sarFindDto.NYLX,jdbcType=VARCHAR},'%')
|
||||
and
|
||||
</if>
|
||||
<if test="sarFindDto.ZRBM != null">
|
||||
b.ZRBM LIKE concat ('%',#{sarFindDto.ZRBM,jdbcType=VARCHAR},'%')
|
||||
and
|
||||
</if>
|
||||
<if test="sarFindDto.SYCPX != null">
|
||||
b.SYCPX LIKE concat ('%',#{sarFindDto.SYCPX,jdbcType=VARCHAR},'%')
|
||||
and
|
||||
</if>
|
||||
a.ID IN
|
||||
<foreach collection="param1" index="index" item="item" open="(" separator="," close=")">
|
||||
<foreach collection="param1" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</where>
|
||||
@@ -41,13 +61,8 @@
|
||||
</where>
|
||||
order by number
|
||||
</select>
|
||||
<select id="selectTypeApplicable" resultType="java.lang.String">
|
||||
SELECT APPLY_ARCTIC
|
||||
FROM sar_stand_items
|
||||
WHERE ID =#{param1,jdbcType=VARCHAR}
|
||||
</select>
|
||||
<select id="selectLawsByIdC" resultType="com.adc.da.slrs.sarLawsAttrDetailedList.entity.LawsDto">
|
||||
SELECT a.ID,a.STAND_NUMBER,a.STAND_NAME,a.STAND_EN_NAME,b.NYLX,a.PUT_TIME,b.XCXSSRQGJ,b.ZCCSSRQGJ,b.ZRBM,b.SYCPX,b.CYCVPPSBM,b.CYCVPPSCN,b.KCCVPPSBM,b.KCCVPPSCN
|
||||
SELECT a.ID,a.STAND_NUMBER,a.STAND_NAME,a.STAND_EN_NAME,b.NYLX,a.PUT_TIME,b.XCXSSRQGJ,b.ZCCSSRQGJ,b.ZRBM,b.SYCPX,b.CYCVPPSBM,b.CYCVPPSCN,b.KCCVPPSBM,b.KCCVPPSCN,b.CLLX as typeApplicable
|
||||
FROM sar_standards_info a LEFT JOIN sar_stand_attr_info b on
|
||||
a.ID = b.STAND_ID
|
||||
<where>
|
||||
@@ -65,12 +80,25 @@
|
||||
</foreach>
|
||||
</where>
|
||||
</select>
|
||||
<select id="selectTimes" resultType="com.adc.da.slrs.sarLawsAttrDetailedList.entity.StandRegionalTimeDto">
|
||||
SELECT
|
||||
b.country_area AS country,
|
||||
a.putTime AS putTime,
|
||||
a.xcxssrq AS xcxssrq,
|
||||
a.zccssrq AS zccssrq
|
||||
FROM
|
||||
sar_laws_attr_detailed_list a
|
||||
LEFT JOIN sar_laws_detailed_list b ON b.id = a.detailed_list_id
|
||||
WHERE
|
||||
b.sort_key = 1
|
||||
AND a.stand_id = #{standId}
|
||||
</select>
|
||||
|
||||
|
||||
<insert id="insertList">
|
||||
INSERT INTO sar_laws_attr_detailed_list ( id, number, detailed_list_id, stand_id ) VALUES
|
||||
INSERT INTO sar_laws_attr_detailed_list ( id, number, detailed_list_id, stand_id ,putTime,xcxssrq,zccssrq) VALUES
|
||||
<foreach collection ="sarLawsAttrDetailedLists" item="list" separator =",">
|
||||
(#{list.id,jdbcType=VARCHAR}, #{list.number}, #{list.detailedListId,jdbcType=VARCHAR}, #{list.standId,jdbcType=VARCHAR})
|
||||
(#{list.id,jdbcType=VARCHAR}, #{list.number}, #{list.detailedListId,jdbcType=VARCHAR}, #{list.standId,jdbcType=VARCHAR},#{list.putTime,jdbcType=VARCHAR},#{list.xcxssrq,jdbcType=VARCHAR},#{list.zccssrq,jdbcType=VARCHAR})
|
||||
</foreach >
|
||||
</insert>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user