tangzy
2021-08-22 886d9f15b0b6c187739ef4d8fa14698eda4120f7
1.单位
6 files modified
47 ■■■■■ changed files
src/main/java/org/springblade/modules/information/controller/InformationController.java 11 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/information/mapper/InformationMapper.java 2 ●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/information/mapper/InformationMapper.xml 27 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/information/service/IInformationService.java 2 ●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/information/service/impl/InformationServiceImpl.java 2 ●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/information/vo/InformationVO.java 3 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/information/controller/InformationController.java
@@ -105,8 +105,8 @@
    @GetMapping("/page")
    @ApiOperationSupport(order = 3)
    @ApiOperation(value = "分页", notes = "传入information")
    public R<IPage<Information>> page(Information information, Query query) {
        IPage<Information> pages = informationService.selectInformationPage(Condition.getPage(query), information);
    public R<IPage<InformationVO>> page(InformationVO information, Query query) {
        IPage<InformationVO> pages = informationService.selectInformationPage(Condition.getPage(query), information);
        return R.data(pages);
    }
@@ -182,13 +182,13 @@
            String id = kv.get("id").toString();
            information.setDepartmentid(id);
        }
        informationService.insertIn(information);
        informationService.save(information);
        String formatStr = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(information.getEstablishtime());
        Integer id = information.getId();
        //Integer id = information.getId();
        String s = "insert into sys_information(id,creditcode,enterprisename,representative,establishtime," +
            "registeredcapital,organizationcode,registrationnumber,identificationnumber, enterprises, address," +
            " business,region,registration,industry,departmentid,stats,jurisdiction,representativecell,contacts,contactscell) " +
            "values(" + "'" + id + "'" + "," + "'" + information.getCreditcode() + "'" + "," + "'" + information.getEnterprisename() + "'" + "," + "'" + information.getRepresentative() + "'" + "," +
            "values(" + "'" + information.getId() + "'" + "," + "'" + information.getCreditcode() + "'" + "," + "'" + information.getEnterprisename() + "'" + "," + "'" + information.getRepresentative() + "'" + "," +
            "'" + formatStr + "'" + "," + "'" + information.getRegisteredcapital() + "'" + "," + "'" + information.getOrganizationcode() + "'" + "," + "'" + information.getRegistrationnumber() + "'" + "," +
            "'" + information.getIdentificationnumber() + "'" + "," + "'" + information.getEnterprises() + "'" + "," + "'" +
            information.getAddress() + "'" + "," + "'" + information.getBusiness() + "'" + "," + "'" +
@@ -214,7 +214,6 @@
    @ApiOperationSupport(order = 5)
    @ApiOperation(value = "修改", notes = "传入information")
    public R update(@Valid @RequestBody Information information) throws Exception {
        //arg.test01(arg.url + "/information/update", information);
        return R.status(informationService.updateById(information));
    }
src/main/java/org/springblade/modules/information/mapper/InformationMapper.java
@@ -40,7 +40,7 @@
     * @param information
     * @return
     */
    List<Information> selectInformationPage(IPage page, @Param("information")Information information);
    List<InformationVO> selectInformationPage(IPage<InformationVO> page, @Param("information")InformationVO information);
    void insertIn(@Param("information")Information information);
    void deleteIn(String creditcode);
    void deleteSh(String creditcode);
src/main/java/org/springblade/modules/information/mapper/InformationMapper.xml
@@ -3,7 +3,7 @@
<mapper namespace="org.springblade.modules.information.mapper.InformationMapper">
    <!-- 通用查询映射结果 -->
    <resultMap id="informationResultMap" type="org.springblade.modules.information.entity.Information">
    <resultMap id="informationResultMap" type="org.springblade.modules.information.vo.InformationVO">
        <id column="id" property="id"/>
        <result column="creditCode" property="creditcode"/>
        <result column="enterpriseName" property="enterprisename"/>
@@ -29,6 +29,9 @@
        <result column="contactscell" property="contactscell"/>
        <result column="businessLicense" property="businessLicense"/>
        <result column="licence" property="licence"/>
        <result column="znum" property="znum"/>
        <result column="cnum" property="cnum"/>
        <result column="pnum" property="pnum"/>
    </resultMap>
@@ -47,21 +50,31 @@
    <select id="selectInformationPage" resultMap="informationResultMap">
        select * from sys_information where 1=1
        SELECT
        i.*,
        IFNULL(A.znum ,0) as znum,
        IFNULL(B.cnum ,0) as cnum,
        IFNULL(C.pnum ,0) as pnum
        FROM
        sys_information i
        LEFT JOIN ( SELECT COUNT( * ) AS znum, dept_id FROM blade_user WHERE role_id = '1412226235153731586' AND is_deleted = 0 GROUP BY dept_id ) A ON A.dept_id = i.departmentid
        LEFT JOIN ( SELECT COUNT( * ) AS cnum, dept_id FROM blade_user WHERE role_id = '1412226235153731586' AND is_deleted = 0 AND hold=1 GROUP BY dept_id ) B ON B.dept_id = i.departmentid
        LEFT JOIN ( SELECT COUNT( * ) AS pnum, dept_id FROM blade_user WHERE role_id = '1412226235153731586' AND is_deleted = 0 AND dispatch=0 GROUP BY dept_id ) C ON C.dept_id = i.departmentid
        where  1=1
        <if test="information.enterprisename!=null and information.enterprisename!=''">
            and enterpriseName like concat(concat('%', #{information.enterprisename}),'%')
            and i.enterpriseName like concat(concat('%', #{information.enterprisename}),'%')
        </if>
        <if test="information.representative!=null and information.representative!=''">
            and representative like concat(concat('%', #{information.representative}),'%')
            and i.representative like concat(concat('%', #{information.representative}),'%')
        </if>
        <if test="information.stats!=null and information.stats!=''">
            and stats=#{information.stats}
            and i.stats=#{information.stats}
        </if>
        <if test="information.jurisdiction!=null and information.jurisdiction!='' and information.jurisdiction!='1123598813738675201'">
            and jurisdiction=#{information.jurisdiction}
            and i.jurisdiction=#{information.jurisdiction}
        </if>
        <if test="information.departmentid!=null and information.departmentid!=''">
            and departmentid=#{information.departmentid}
            and i.departmentid=#{information.departmentid}
        </if>
    </select>
src/main/java/org/springblade/modules/information/service/IInformationService.java
@@ -41,7 +41,7 @@
     * @param information
     * @return
     */
    IPage<Information> selectInformationPage(IPage<Information> page, Information information);
    IPage<InformationVO> selectInformationPage(IPage<InformationVO> page, InformationVO information);
    void deleteIn(String creditCode);
    void deleteSh(String creditCode);
    void insertIn(Information information);
src/main/java/org/springblade/modules/information/service/impl/InformationServiceImpl.java
@@ -58,7 +58,7 @@
public class InformationServiceImpl extends ServiceImpl<InformationMapper, Information> implements IInformationService {
    @Override
    public IPage<Information> selectInformationPage(IPage<Information> page, Information information) {
    public IPage<InformationVO> selectInformationPage(IPage<InformationVO> page, InformationVO information) {
        return page.setRecords(baseMapper.selectInformationPage(page, information));
    }
src/main/java/org/springblade/modules/information/vo/InformationVO.java
@@ -38,6 +38,9 @@
     * 单位名称
     */
    private String deptName;
    private String znum;
    private String cnum;
    private String pnum;