linwe
2024-05-29 c10d6358b9f014375a13821465bc978d0c0da22e
src/main/java/org/springblade/modules/backblast/mapper/BackblastPubRecordMapper.xml
@@ -12,11 +12,14 @@
        jbpr.*,
        br.town_name as townName,
        br.name as communityName,
        jpag.pcs_name pcsName
        jpag.pcs_name pcsName,
        bd.dept_name
        from jczz_backblast_pub_record jbpr
        LEFT JOIN jczz_grid jg on jg.grid_code = jbpr.grid_code and jg.is_deleted = 0
        LEFT JOIN jczz_police_affairs_grid jpag on jbpr.jw_grid_code= jpag.jw_grid_code and jpag.is_deleted = 0
        LEFT JOIN blade_region br on br.code = jpag.community_code
        LEFT JOIN blade_user bu ON bu.id = jbpr.create_user
        LEFT JOIN blade_dept bd on bd.id = bu.dept_id
        where jbpr.is_deleted = 0
        <if test="backblastPubRecord.townName != null and backblastPubRecord.townName != ''">
            and br.town_name like concat('%',#{backblastPubRecord.townName},'%')
@@ -33,11 +36,17 @@
        <if test="backblastPubRecord.address != null and backblastPubRecord.address != ''">
            and jbpr.address like concat('%',#{backblastPubRecord.address},'%')
        </if>
          <if test="backblastPubRecord.deptName != null and backblastPubRecord.deptName != ''">
            and  bd.dept_name like concat('%',#{backblastPubRecord.deptName},'%')
        </if>
        <if test="backblastPubRecord.pubContent != null and backblastPubRecord.pubContent != ''">
            and jbpr.pub_content like concat('%',#{backblastPubRecord.pubContent},'%')
        </if>
        <if test="backblastPubRecord.policeman != null and backblastPubRecord.policeman != ''">
            and jbpr.policeman like concat('%',#{backblastPubRecord.policeman},'%')
        </if>
        <if test="backblastPubRecord.createUser != null">
            and jbpr.create_user = #{backblastPubRecord.createUser}
        </if>
        <if test="backblastPubRecord.policemanPhone != null and backblastPubRecord.policemanPhone != ''">
            and jbpr.policeman_phone like concat('%',#{backblastPubRecord.policemanPhone},'%')
@@ -115,17 +124,35 @@
        order by jbpr.id desc,jbpr.create_time desc
    </select>
    <!--详情map-->
    <resultMap id="detailMap" type="org.springblade.modules.backblast.vo.BackblastPubRecordVO" autoMapping="true">
        <id property="id" column="id"/>
        <collection property="backblastPubPersonEntityList" javaType="java.util.List"
                    ofType="org.springblade.modules.backblast.entity.BackblastPubPersonEntity"
                    autoMapping="true">
            <id property="id" column="cid"/>
            <result property="address" column="caddress"/>
        </collection>
    </resultMap>
    <!--反炸宣传记录表 自定义详情-->
    <select id="getDetail" resultType="org.springblade.modules.backblast.vo.BackblastPubRecordVO">
    <select id="getDetail" resultMap="detailMap">
        select
        jbpr.*,
        br.town_name as townName,
        br.name as communityName,
        jpag.pcs_name pcsName
        jpag.pcs_name pcsName,
        jbpp.id as cid,
        jbpp.name,
        jbpp.telephone,
        jbpp.id_card,
        jbpp.address as caddress,
        jbpp.occupation
        from jczz_backblast_pub_record jbpr
        LEFT JOIN jczz_grid jg on jg.grid_code = jbpr.grid_code and jg.is_deleted = 0
        LEFT JOIN jczz_police_affairs_grid jpag on jbpr.jw_grid_code= jpag.jw_grid_code and jpag.is_deleted = 0
        LEFT JOIN blade_region br on br.code = jpag.community_code
        LEFT JOIN jczz_backblast_pub_person jbpp on jbpp.backblast_pub_record_id = jbpr.id and jbpp.is_deleted = 0
        where jbpr.is_deleted = 0
        <if test="backblastPubRecord.id != null">
            and jbpr.id = #{backblastPubRecord.id}